Search code examples
actionscript-3google-chromefullscreendelaystagedisplaystate

AS3 fullscreen delay in chrome


How can I hide all controls before stageDisplayState changes? setTimeout and Timer cannot be used to delay switching to fullscreen. I have created a curtain element that I want to show BEFORE the display state change. Timeout, timers, and mousedown events do not give any change events in my application, so what can I do?

stage.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void {

    //curtain shows AFTER enter to fullscreen mode - must before
    curtain.visible = true;
    stage.displayState = StageDisplayState.FULL_SCREEN;
});

Any tips, dear ActionScript masters?


Solution

  • You can't really do this.
    You can only enter full screen mode in response to a user click (Adobe: working with full-screen mode).

    So if you pause to do any animation or screen updating, you are no longer responding directly to a user click.

    The only thing you could do would be to animate on the curtain and then throw up another button for the user to click to really enter full screen. That's not a very elegant solution though.