PDA

View Full Version : Constraining a movieclip to the bottom of browser?



Filmguy15
May 11th, 2007, 10:19 AM
Ok this is an effect many websites employ, but I'm unsure on how to accomplish it. One that comes to mind is
http://www.chromazone-imaging.co.uk/flashindex.html

Nevermind the sweet background effect, that's for another day. See how the logo at the bottom right is always constrained to the bottom when you resize the browser? That's what I would like to do. I'd like to have a movieclip that will slide in at the start, then wherever it slides in to (depending on which button is pressed) It will stick there, relative to the bottom of the browser. Any help would be appreciated! Thanks!

_Filmguy15

Icy Penguin
May 11th, 2007, 08:15 PM
You'd just update its x pos after the stage is resized. Not quite sure yet the exact syntax, but you would use the width and height of the Stage to find out the correct x position.

SiCk
May 11th, 2007, 09:07 PM
this.box._x = Number(Stage.width - box._width);
this.box._y = Number(Stage.height - box._height);
There is a movieclip called box on stage with a instance name "box".

externe
May 13th, 2007, 11:10 AM
_x _width, ... removed

dthought
May 13th, 2007, 09:44 PM
There is a movieclip called box on stage with a instance name "box".

In AS2.0 that would have been fine. In AS3.0, things are veeery different.



// For completeness... assuming BoxItem is a linked class from the library
var box:BoxItem = new BoxItem();
addChild(box);

box.x = stage.stageWidth - box.width;
box.y = stage.stageHeight - box.height;