tags:

views:

201

answers:

1

I'm trying to get my Air app to display the NativeWindow to the user (the app is normally hidden down in the system tray) when the system is shutdown. I'm using the following code currently which works nicely if the exit button is pressed, but it doesn't work when the system is shut down. I'm using a custom chrome. Any help would be much appreciated.

NativeApplication.nativeApplication.addEventListener(Event.EXITING, this.Application_Exiting);

private function SysTrayExit_Select(e: Event):void{
      this.applicationExit();
}

public function applicationExit():void { 
    var exitingEvent:Event = new Event(Event.EXITING, false, true);

    NativeApplication.nativeApplication.dispatchEvent(exitingEvent);

    if (!exitingEvent.isDefaultPrevented()) {

        NativeApplication.nativeApplication.exit();

    }  }

private function Application_Exiting(e: Event): void {


      e.preventDefault();

      Alert.show("Exiting");
      ShowTaskEntry();  
}
A: 

Unless you can access the APIs for the platform in the ActionScript, there is no real way to do it.

Daniel A. White