Skip to content

Instantly share code, notes, and snippets.

@arpit
Created January 18, 2010 08:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arpit/279876 to your computer and use it in GitHub Desktop.
Save arpit/279876 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute" width="400" height="300" creationComplete="minimizeToDock()">
<mx:Label text="Dockable" horizontalCenter="0" verticalCenter="0">
</mx:Label>
<mx:Script>
<![CDATA[
private function minimizeToDock():void{
nativeWindow.addEventListener(Event.CLOSING, function(event:Event):void{
event.stopImmediatePropagation();
event.preventDefault();
nativeWindow.visible = false;
nativeApplication.addEventListener(InvokeEvent.INVOKE, function(event:InvokeEvent):void{
trace(" Invoking...");
nativeWindow.visible = true;
});
});
}
]]>
</mx:Script>
</mx:WindowedApplication>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment