What is the right way to scale a Flex application up to fullscreen?

Posted by Impirator on Stack Overflow See other posts from Stack Overflow or by Impirator
Published on 2010-03-10T10:19:36Z Indexed on 2010/05/07 4:08 UTC
Read the original article Hit count: 484

Filed under:
|
|
|

Fullscreen mode and I have been battling for a while in this Flex application, and I'm coming up short on Google results to end my woes. I have no problem going into fullscreen mode by doing a Application.application.stage.displayState = StageDisplayState.FULL_SCREEN;, but the rest of the content just sits there in the top, left corner at it's original size.

All right, says I, I'll just do a stage.scaleMode = StageScaleMode.SHOW_ALL and make it figure out how to pull this off. And it looks like it does. Except that when you mouse over the individual checkboxes and buttons and various components, they all fidget slightly. Just a slight jump up or down as they resize...on mouse over. Well, this is frustrating, but bearable. I can always just invoke invalidateSize() explicitly for all of them.

But for the comboboxes. The ones at the bottom have their menus go off the bottom of the screen, and when I pop out of fullscreen mode, their drop downs cut off half way. I have no idea how to fix that. Can someone step in here, and put me out of my misery?

What is the right way to scale a Flex application up to fullscreen?

var button:Button = button_fullscreen;
try {
    if(stage.displayState == StageDisplayState.FULL_SCREEN) {
        Application.application.stage.displayState = StageDisplayState.NORMAL;
        button.label = "View Fullscreen Mode";
        stage.scaleMode = StageScaleMode.NO_SCALE;
    } else {
        Application.application.stage.displayState = StageDisplayState.FULL_SCREEN;
        button.label = "Exit Fullscreen Mode";
        stage.scaleMode = StageScaleMode.SHOW_ALL;
    }
    invalidateSizes(); // Calls invalidateSize() explicitly on several components.
} catch(error:SecurityError) {
    Alert.show("The security settings of your computer prevent this from being displayed in fullscreen.","Error: "+error.name+" #"+error.errorID);
} catch(error:Error) {
    Alert.show(error.message,error.name+" #"+error.errorID);
}

© Stack Overflow or respective owner

Related posts about flex

Related posts about actionscript-3