apache-flexairflex4flex-mobile

Make Flex mobile full screen in desktop (as an air app)


I need to make flex mobile application to be full screen when it runs on desktop OSs (I've packaged it as an air app)


Solution

  • I'm pretty sure that your view will dispatch it's creationComplete event before the main Application is added to the stage, which is probably why you got the error.

    In the past, I've used the applicationComplete event and the StageDisplayState.FULL_SCREEN. Here is an old blog post I wrote about it.

    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" alwaysInFront="true"
    applicationComplete="onApplicationComplete()">
    <mx:Script><![CDATA[
    
    public function onApplicationComplete():void{
    this.stage.displayState = StageDisplayState.FULL_SCREEN;
    }
    ]]></mx:Script>
    </mx:WindowedApplication>
    

    I see no reason why this code wouldn't work in a Flex 4 / Spark app.