PDA

View Full Version : Lost focus after return from FULL_SCREEN


feklee
06-05-2008, 07:15 PM
The following code example illustrates the problem below that I experience e.g. under OSX/Safari (see point 6). Any idea how to prevent the loss of focus when returning from full screen mode?

1. App starts

2. User clicks

3. Full Screen

4. User clicks

5. Normal Screen

6. User has to click twice (first click to get focus)

7. Full Screen

Code example:

package {
import flash.display.*;
import flash.events.*;
import flash.ui.*;

public class Test extends Sprite {
public function Test() {
stage.addEventListener(MouseEvent.CLICK, onClick);
}

private function onClick(event:MouseEvent):void {
if (stage.displayState == StageDisplayState.FULL_SCREEN)
stage.displayState = StageDisplayState.NORMAL;
else
stage.displayState = StageDisplayState.FULL_SCREEN;
}
}
}