Turn off the interrupt system in Adobe Air

I'm trying to get the Air app to show a NativeWindow to the user (the app usually hides in the system tray) when the system shuts down. I am 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 am using my own chrome. Any help is 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();  
}

      

0


a source to share


1 answer


If you cannot access the platform APIs in ActionScript, there is no real way to do it.



0


a source







All Articles