stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE
but turned out all my components dont get centered on the screen as needed(when in full screen) and they get cutoff or they are off screen. Basically the application was developed in lower resolution about 1024x768...but now it needs to run full screen.Also the application loads various modules at runtime they also dont appear to be centered in fullscreen.When the application comes out of fullscreen it also shows scrollbars for the application window..
Edit :Code added :
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2开发者_如何学编程006/mxml"
layout="absolute" width="1024" height="768">
<Application:ApplicationStartContainer id="aps" width="100%" height="100%">
<mx:ModuleLoader id="moduleLoader"/>
</Application:ApplicationStartContainer>
</mx:WindowedApplication>
On start, the Application goes fullscreen,and the module loader loads modules/swfs
that are of size 1024*768 ,but currently all loaded modules get aligned to x=0 and y=0.Any ideas?
Thanks all.
layout all of your display objects in a display object container - as children of a new sprite, and listen for a full screen event to center the display object container.
stage.addEventListener(FullScreenEvent.FULL_SCREEN, fullScreenEventHandler);
//assuming the registration point of 'container' is top-left
function fullScreenEventHandler(evt:FullScreenEvent):void
{
container.x = stage.stageWidth / 2 - container.width / 2;
container.y = stage.stageHeight / 2 - container.height / 2;
}
note that the full screen event is dispatched when both entering and leaving full screen mode.
精彩评论