AS3: How to get fullscreen and keyboard input?

17,174

Solution 1

public function setFullScreen():void
            {
                this.width = Capabilities.screenResolutionX;
                this.height = Capabilities.screenResolutionY;
                this.stage.align = StageAlign.TOP_LEFT;
                this.stage.scaleMode = StageScaleMode.NO_SCALE;
                this.stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;

            }

Use the FULL_SCREEN_INTERACTIVE

Solution 2

This is now possible in Flash Player 11.3+

Simply compile your application to support a minimum version of 11.3.0 and it will work if you use:

stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;

in your html you must put:

<param name="allowFullScreenInteractive" value="true" />

you will see a prompt when you enter full screen:

Permission Overlay

you can see an example on this official adobe blog: http://www.leebrimelow.com/wp-content/uploads/2012/04/overlay.gif

Solution 3

It is not possible to get input key with fullscreen mode within the browser.

Air is only for desktop application so if your application have to work into the browser no Air for you.

If you have to get input into fullscreen mode you can try to make a virtual keyboard (an example) and user will use the mouse to press the keyboard key.

Solution 4

It actually is possible in Flash 10, but only for a few keys. See this page: Understanding the security changes in Flash Player 10

Flash Player 9 does not allow keyboard input when displaying content in full-screen mode. Flash Player 10 changes this, allowing for a limited number of keys to be usable in full-screen mode. These include Tab, the Spacebar, and the (up, down, left, right) arrow keys.

Solution 5

Another option is to just use the browser's built-in fullscreen capability. All major browsers offer it as far as I know (IE, Firefox, Chrome, etc). Usually it's under View->Fullscreen, hotkey F11. Depending on the browser it will either give you the entire screen, or maybe leave a small bar across the top/bottom. Then you simply need to make your flash application expand to fill the entire HTML page.

Share:
17,174
Admin
Author by

Admin

Updated on July 12, 2022

Comments

  • Admin
    Admin over 1 year

    Since flash doesn't allow keyboard input while in fullscreen mode I'm wondering if there is a workaround to that?

    I have a flash that is going to run fullscreen in a browser and needs different kinds of keyboard input. I have read something about AIR, but I don't fully understand it and would like another way if thats even possible.

    Anybody knows?