public static function applicationExit():void { var exitingEvent:Event = new Event(Event.EXITING, false, true); NativeApplication.nativeApplication.dispatchEvent(exitingEvent); if(!exitingEvent.isDefaultPrevented()) { NativeApplication.nativeApplication.exit(); } }