Restore, Resize, and Move a window with Apollo

We’re having a bunch of fun with the Apollo alpha over here at Curious Minds. Here is some simple code that will replicate OS window behavior. The maximizeWindow function either sets the app window to full screen or restores the size of the window depending on the state of the isWindowMax variable. These functions are all tied to the “click” function of the appropriate buttons.

import flash.events.MouseEvent;
import flash.display.NativeWindowResize;
public var isWindowMax:Boolean = new Boolean(false);
public function maximizeWindow():void{
if(isWindowMax){
restoreWindow();
isWindowMax = false;
}else{
this.stage.window.maximize();
isWindowMax = true;
}
}
public function restoreWindow():void{
this.stage.window.restore();
}
public function onStartMove(event:MouseEvent):void{
this.stage.window.startMove();
}
public function onStartResize(event:MouseEvent):void{
this.stage.window.startResize(NativeWindowResize.BOTTOM_RIGHT);
}

About Curious Minds
We are a web development firm in New York and Chicago, providing development resources and consulting for websites and mobile apps since 2004.