// $background and $close can be any mouse-active
// display object on the stage, of course
// close the app on clicking a button
$close.addEventListener(MouseEvent.CLICK, closeApp);
function closeApp(ev:MouseEvent)
{
var myWindow:NativeWindow = this.stage.nativeWindow;
if (myWindow) myWindow.close();
}
// drag app around
$background.addEventListener(MouseEvent.MOUSE_DOWN, startMove);
function startMove(ev:MouseEvent)
{
var myWindow:NativeWindow = this.stage.nativeWindow;
if (myWindow) myWindow.startMove();
}
You can do a lot more than that, of course.
No comments:
Post a Comment