2 Replies Latest reply on Jun 9, 2011 1:22 AM by Peter Blazejewicz

    AIR 2.6 HTML Component and window.close()

    Jim Leichliter Level 4

      I've got an AIR desktop app that is displaying conent via the HTML component.  I'd like for the user to click a button on the html page that does a window.close(); to close the main window... exiting the app.

       

      I've subclassed the HTMLHost class and overrided the windowClose() method:

      override public function windowClose():void 
           { 
           htmlLoader.stage.nativeWindow.close(); 
           }
      

       

      This seems to work well for closing pop-up windows, but not the main window.  How do I close the main window from JS?

       

      Thanks,

       

      Jim Leichliter