/ Published in: ActionScript 3
If you don't do this, then there's a chance that a user will quit the program but windows will still be viewable.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
this.nativeWindow.addEventListener(Event.CLOSING, function(e:Event):void { e.preventDefault(); for (var i:int = NativeApplication.nativeApplication.openedWindows.length - 1; i >= 0; --i) { NativeWindow(NativeApplication.nativeApplication.openedWindows[i]).close(); } });