Posted By

chrisaiv on 10/30/08


Tagged

AIR as3 NativeApplication


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

THEPWN3R
dx0ne
toxin20
thastyle


AIR: Closing all possible Windows before the Application Quits


 / 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.

  1. this.nativeWindow.addEventListener(Event.CLOSING,
  2. function(e:Event):void
  3. {
  4. e.preventDefault();
  5. for (var i:int = NativeApplication.nativeApplication.openedWindows.length - 1; i >= 0; --i)
  6. {
  7. NativeWindow(NativeApplication.nativeApplication.openedWindows[i]).close();
  8. }
  9. });

Report this snippet  

You need to login to post a comment.