Starling and Feathers Full Screen Button

Today I tried to make a full screen button for my Christmas Day Countdown online application. With that application I’m using Starling with Feathers components. If you listen for Event.TRIGGERED on a Feathers button and then change the displayState, you will get a Security error:

SecurityError: Error #2152: Full screen mode is not allowed.

Flash Player is expecting a MouseEvent when changing the displayState, it will not work with a Touch event. I looked for a workaround and I found this forum topic. After I made some improvements, I finally had a working full screen button triggered from Starling. The code below works like a charm:

Starling.current.nativeStage.addEventListener(MouseEvent.MOUSE_DOWN, toggleFullScreen);
 
private function toggleFullScreen(event:MouseEvent):void
{
	if(_fullScrenButton.stage != null)
	{
		if(_fullScrenButton.stage.hitTest(new Point(event.stageX, event.stageY)) == _fullScrenButton)
		{
			if(Starling.current.nativeStage.displayState == StageDisplayState.FULL_SCREEN)
			{
				Starling.current.nativeStage.displayState = StageDisplayState.NORMAL;
			}
			else
			{
				Starling.current.nativeStage.displayState = StageDisplayState.FULL_SCREEN;
			}
		}
	}
}
MiniPong Game

My first game published for mobile devices is here.

Made in Flash Builder with Adobe AIR, Startling and Feathers (for the buttons and other components). Next on my list is to publish it to iOS, but for that, I need to get myself a Mac first, since Apple does not allow developers without an Apple machine to compile the application for the App Store.

For now, please check the Android version and let me know if you like it:
MiniPong Game on Google Play

Update:
The game has a new graphic interface and it’s also available online:
www.vamapaull.com/games/minipong