Nicola
Nicola

Reputation: 1

How to close a video from full screen without closing the projector full screen

I am creating a full screen projector with flash CS4. In the projector I have more videos, starting from an swf player-

The problem I encounter is this:

The projector starts correctly FULLSCREEN (using AS). The video plays 900x506 correctly. If I click on the player, to get the video full screen, it works. But when I press ESC, not only the video, but also the PROJECTOR looses full screen.

This is a bit annoying. Is there a way to apply the "back to normal size" only to the video? I do not want to prevent the app to be exited from full screen, it's not a problem if the user wants to exit the projector full screen. But not when the user exits the video from fullscreen mode.

How to target only the video?

Upvotes: 0

Views: 660

Answers (1)

loxxy
loxxy

Reputation: 13151

You will sure have to add another button to atleast let the user out. The key has actually allowed people to get out of anything since long.

So please do let them have another button or something...(in case they dun like any of those movies in the projector :p)

Well Here is what I suggest without changing much.

  • Listen for the escape press.
  • If when a user presses Escape & it is getting people out of the fullscreen during video.
  • Push them back into the projector fullscreen.

Something like this:

import flash.display.StageDisplayState;

stage.addListener(KeyboardEvent.KEY_DOWN, keyDownHandler);

function keyDownHandler(event : KeyboardEvent) : void
{
    if (event.keyCode == Keyboard.ESCAPE)
    {
     goFullScreen();
    }
}

function goFullScreen():void
{
    if (stage.displayState == StageDisplayState.NORMAL) 
       {
        stage.displayState=StageDisplayState.FULL_SCREEN;
       } 
}

Upvotes: 0

Related Questions