Wednesday, April 1, 2009

Flash Liquid Layout

I have updated the 'Liquid Layout' recipe from Tutorio to AS3. 

Step 1. Ensure the HTML publishing setting in your Flash IDE at 100% height and 100% width. Align at top left.

Step 2. Copy and paste the following into the 1st Frame of the timeline. Make adjustments where necessary:


stage.addEventListener(Event.RESIZE, repositionElements)
//
function repositionElements(myevent:Event):void{
trace(stage.stageWidth);
trace(stage.stageHeight);
//'Box' being your movieclip or artwork
Box.y=stage.stageHeight-40;
}

No comments:

Post a Comment