Search code examples
actionscript-3apache-flexflex4

FullScreen button not working - as3


In my application, I am keeping so much of container with components. Now I have to create Fullscreen button for VideoDisplay. I tried some what like the followings

systemManager.stage.displayState = StageDisplayState.FULL_SCREEN;

And

this.stage.addChild(videoDisplay);
this.stage.displayState = StageDisplayState.FULL_SCREEN;
videoDisplay.width = stage.width;
videoDisplay.height = stage.height;

But no use. Is any other way is there to do it?


Solution

  • If your app is going to fullscreen but your video doesn't then you should probably resize it using size of your full screen:

    videoDisplay.width = stage.fullScreenWidth;
    videoDisplay.height = stage.fullScreenHeight;
    

    But since your video will probably deform when adjusting to different screen dimensions (3:4, 9:16 etc) you should resize only one side and adjust the other like this:

    videoDisplay.width = stage.fullScreenWidth;
    videoDisplay.scaleY = videoDisplay.scaleX;