I try to open my swf in fullscreen mode by user clicking the button, without any success for now. I keep getting the "SecurityError: Error #2152: Full screen mode is not allowed."
My HTML looks OK with all possible allowFullScreen parameters set to true.
I suspect that my problem might be in the fact that I use lots of external swfs in my application. And to close the Error alert window I have to click several times on it.
How can I make my "fullscreen" button work?
I honestly searched Internet and Flashkit forums for the answer to my problem, but looks like nobody else was having it.
The ActionScript that initiates full-screen mode can be called only in response to a mouse event or keyboard event. If it is called in other situations, Flash Player throws an exception.
Thank you for the answer. It exactly pointed to my mistake.
When I wanted to reply that my user does click the button to open fullscreen, I checked my code and found that instead of doing it from the click handler in one class (menu class), I sent event to the other class (layout class) and tried to open fullscreen from there.
Looks like the only place where I can put string
"stage.displayState = StageDisplayState.FULL_SCREEN;"
is the click handler itself.