0
votes

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)

2
I don't understand what you're asking. How do you run a Flex Mobile application on a Desktop OS?JeffryHouser
I think he means AIR, not simply mobile. But the bigger question is, what's been tried already? What documentation has he looked at? Where did it not meet his needs? I don't know about you, but I'm not interested in retyping the Help.Amy Blankenship
Amy is right I'm talking about AIR...(exporting application as an AIR to run it on desktop).. But I couldn't do it using just stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE; statement - I called this on CreationComplete of the first view but it threw an exception..Exception is: TypeError: Error #1009: Cannot access a property or method of a null object reference. at views::LoginView/login_creationCompleteHandler()[/Users/lbstr/Documents/workspace-sts-2.7.2.RELEASE/ClinAST/src/views/LoginView.mxml:156]Zaur Guliyev

2 Answers

0
votes

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.

0
votes

Switching to full screen through stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE can not be done on a creation complete handler. It must be done through user interaction. I actually just did this yesterday. Add a button to your app and set the onClick to a function that sets full screen and hides the button. That's how I did it anyways.