Flash AS3 fullscreen problem: screen reverts to normal mode
I've got a fullscreen button which, when clicked, works. However, after a few seconds, Flash automatically exits full-screen mode and reverts to normal mode. I'm running this in the browser. I tried stripping all the code 开发者_C百科in the fullScreen event handler down to this (I removed toggling between displayStates):
private function fullScreenHandler( event:MouseEvent ):void
{
stage.displayState=StageDisplayState.FULL_SCREEN;
}
It's still happening. Has anyone seen this before?
Does it exit fullscreen after the same amount of time every time? It could be something silly like the computer going to sleep then. I've never experienced flash player standalone exiting fullscreen in such a case but I could imagine because its in a browser that changes things.
So I'd suggest to try running it from the flash player as opposed to the browser if you can. This should tell you if it is something wrong with your app or the browser.
On the same note try it on different browsers. Since I imagine its fairly portable you should also consider trying it on different physical computers.
Try to hang function on full screen exiting, insert some code which will throw an exception (e.g. try to call some method of a null, it's the simpliest way in Haxe/Flash) and see stack trace of exception. You'll see what causes exit from full-screen.
精彩评论