<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" creationComplete="windowedapplication1_creationCompleteHandler(event)" applicationComplete="windowedapplication1_applicationCompleteHandler(event)">
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
import spark.components.Application;
protected function windowedapplication1_creationCompleteHandler(event:FlexEvent):void
{
nativeWindow.stage.addEventListener(KeyboardEvent.KEY_DOWN, this.onKeyDown);
}
protected function windowedapplication1_applicationCompleteHandler(event:FlexEvent):void
{
stage.addEventListener(FullScreenEvent.FULL_SCREEN, this.fullScreenHandler);
this.toggleFullScreen();
}
protected function onKeyDown(event:KeyboardEvent):void
{
if (event.keyCode == 27)
{
event.preventDefault();
}
}
private function fullScreenHandler(evt:FullScreenEvent):void
{
// TODO : ESC키를 눌러 nomal모드로 변경 못하도록 처리
if(stage.displayState == StageDisplayState.NORMAL)
stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
}
private function toggleFullScreen():void
{
try
{
switch (stage.displayState)
{
case StageDisplayState.FULL_SCREEN:
stage.displayState = StageDisplayState.NORMAL;
break;
default:
stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
break;
}
}
catch (err:SecurityError)
{
//
}
}
protected function textarea1_keyDownHandler(event:KeyboardEvent):void
{
trace(event.keyCode);
}
]]>
</fx:Script>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:Button x="426" y="431" label="Button"/>
<s:Label x="270" y="202" text="Label"/>
<s:Label x="570" y="202" text="Label"/>
<s:TextArea x="362" y="240" width="251" height="80" keyDown="textarea1_keyDownHandler(event)"/>
</s:WindowedApplication>