ActionScript Full Screen function

// June 11th, 2009 // Code

Started working on a new Flex project today and found myself searching the docs for the correct syntax in making Full Screen apps so I figured I’d post it here and hopefully I’ll remember this function next time I need it.

private function toggleFullScreen():void
{
    try 
    {
        switch (systemManager.stage.displayState) 
        {
            case StageDisplayState.FULL_SCREEN:
                systemManager.stage.displayState = StageDisplayState.NORMAL;
                break;
            default:
                systemManager.stage.displayState = StageDisplayState.FULL_SCREEN;
                break;
        }
    } 
    catch (err:SecurityError) 
    {
    }
}

Leave a Reply

You must be logged in to post a comment.