Question

I've created an AIR application in Flash CS4 with AS3, and the application needs to start up as fullscreen. I put a slight delay on the fullscreen call to get around the fact that flash won't let you start an application in fullscreen. This works fine on windows. However, on Mac, my application has an issue...

It uses this code to go fullscreen on startup:

var fullscreen_delay:Timer=new Timer(10,1);// delay to bypass flash's non-fullscreen-on-startup feature

fullscreen_delay.start();
fullscreen_delay.addEventListener(TimerEvent.TIMER_COMPLETE, function(){
    stage.displayState=StageDisplayState.FULL_SCREEN_INTERACTIVE;
    fullscreen_delay.removeEventListener(TimerEvent.TIMER_COMPLETE,arguments.callee);
    fullscreen_delay=null;

});

The application successfully goes fullscreen, but leaves the window for the application sitting in front of the fullscreen view. Toggling in and out of fullscreen on keypress fixes the issue. I thought that doing something like this:

var fullscreen_delay:Timer=new Timer(10,1);// delay to bypass flash's non-fullscreen-on-startup feature

fullscreen_delay.start();
fullscreen_delay.addEventListener(TimerEvent.TIMER_COMPLETE, function(){
    stage.displayState=StageDisplayState.FULL_SCREEN_INTERACTIVE;
    fullscreen_delay.removeEventListener(TimerEvent.TIMER_COMPLETE,arguments.callee);
    fullscreen_delay=null;
    stage.displayState=StageDisplayState.NORMAL;
    stage.displayState=StageDisplayState.FULL_SCREEN_INTERACTIVE;
});

Or even delaying the extra StageDisplayState.NORMAL; and `StageDisplayState.FULL_SCREEN_INTERACTIVE; by 100 milliseconds each would simulate the effect of the keypress toggle, and this provide a functional, albeit dirty, workaround to this problem. However, these things do not work.

Does anyone have any idea what is going on?

[EDIT]


Putting a ridiculously long delay on the fullscreen call (5000 milliseconds) seems to do the trick. I realized this when I launched the application and immediately started mashing the space bar (my fullscreen toggle key), which kept presenting me with the same issue until after 3 or 4 seconds, at which point the fullscreen began working properly.

Still, if anyone knows anything about this... please share.

Was it helpful?

Solution

Putting a ridiculously long delay on the fullscreen call (5000 milliseconds) seems to do the trick. I realized this when I launched the application and immediately started mashing the space bar (my fullscreen toggle key), which kept presenting me with the same issue until after 3 or 4 seconds, at which point the fullscreen began working properly.

Still, if anyone knows anything about this... please share.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top