A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Fullscreen doesn't work

  1. #1
    Member
    Join Date
    Nov 2002
    Posts
    43

    Fullscreen doesn't work

    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.

  2. #2
    Member
    Join Date
    Oct 2006
    Location
    Belgium
    Posts
    36
    Hi olka_sb,

    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.

    For more information on this go to http://help.adobe.com/en_US/ActionSc...0204-7c5d.html

    PHP Code:
    stage.addEventListener (KeyboardEvent.KEY_DOWNthis.goFullScreen);
    //
    function goFullScreen (param1:KeyboardEvent):void
    {
        if (
    param1.keyCode == 32)
        {
            switch (
    stage.displayState)
            {
                case 
    "normal" :
                    
    stage.displayState "fullScreen";
                    break;
                case 
    "fullScreen" :
                default :
                    
    stage.displayState "normal";
                    break;
            }
        }

    Attached Files Attached Files

  3. #3
    Member
    Join Date
    Nov 2002
    Posts
    43
    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.

    It's working now. Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center