|
-
If you're aiming for a fluid layout, where everything is positioned/sized based on the size of the stage, you might need to look at Stage.scaleMode = StageScaleMode.NO_SCALE. This mode means that nothing is scaled, however, so it could mess up your work flow.
You can, however, add an event listener for when the stage's size is adjusted (unlike with the showAll scale mode, that Nig 13 pointed out) so that you can adjust the size of your content. A basic example would be:
Code:
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.addEventListener(Event.RESIZE, resizeContent, false, 0, true);
function resizeContent(evt:Event):void{
menuBar.width = stage.stageWidth;
}
The stage.align property says that all objects are positioned from the top left, so at the very top left, x and y are 0. So placing menuBar at x = 0 will attach it to the left side of the stage, and resizing the width to equal the stage's width will simply stretch it out across the page.
Here's a good site if you want to get another example (that's better easier to understand than mine too). http://www.kirupa.com/developer/as3/...tering_as3.htm
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|