PDA

View Full Version : Full Screen Handler



OML
January 19th, 2009, 09:44 AM
Hello,

I am trying to catch the FullScreenEvent when the user enters or exits full-screen mode.
In the following code, I just wanted to see that the event is handled, but unfortunately no event is received when I enter full-screen mode from the flash player.



stage.addEventListener(FullScreenEvent.FULL_SCREEN , FullScreenHandler);

protected function FullScreenHandler(fsEvent:FullScreenEvent):void
{
var s:Sprite = new Sprite();
s.graphics.beginFill(0xffffff,1);
s.graphics.drawRect(10,10,30,30);
s.graphics.endFill();

if (stage.displayState == StageDisplayState.FULL_SCREEN)
{
addChild(s);
}
else if (stage.displayState == StageDisplayState.NORMAL)
{
removeChild(s);
}
}
Am I doing something wrong, or maybe the FullScreenEvent is never sent when toggling full-screen mode from a flash player?

Thanks,
OML

OML
January 20th, 2009, 04:51 AM
?