Rectangle 27 0

actionscript 3 flash components and resizing?


import flash.display.StageAlign;
import flash.display.StageScaleMode;

...

public function InitializeChatProgram() 
{
    stage.scaleMode = StageScaleMode.NO_SCALE;
    stage.align = StageAlign.TOP_LEFT;
}
Note
Rectangle 27 0

actionscript 3 flash components and resizing?


stage.addEventListener(Event.RESIZE, resizeHandler);

private function resizeHandler(event:Event):void {
   component.x = (stage.stageWidth+component.width) / 2;
}

If don't want to rearrange them and scale them proportionally, try to set the stage scale mode to other StageScaleMode values.

In order to resize your objects properly, you need to rearrange them when the size of the window changes. For instance, if your chat component must be horizontally centered, your code would like :

Note