/* * How to gracefully handle the closing event on a mac */ napp.openedWindows[0].addEventListener(Event.CLOSING, function(e:Event):void { var w:NativeWindow = e.currentTarget as NativeWindow; if(w.active) { e.preventDefault(); napp.openedWindows[0].visible = false; } else { napp.exit(); } });