Fastest way of closing AIR application
Friday, February 6th, 2009If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!
Today on FlexLib mailinglist I’ve found quite nice and interesting question:
Dear Folks,
In my appliaction, The code: “application.close();” is used to exit
the application.
And I found, no. of ways are there to exit the application. Let me
know, which one is best , should allow the
grace full exit and should faster.No. of ways to Exit in Flex:
1. NativeApplication.nativeApplication.exit();
2. Application.application.exit();
3. application.close();
4. exit();And please advise, any other option is there to exit the application.
Thanks in Advance
Lokh
What are your experiences with closing AIR application. Do you think it’s matters on function which is closing AIR application?
Post your thoughts and I will post them to the FlexLib mailinglist.
Thank you






2 Comments
James
• Visit Site
February 6th, 2009
I use NativeApplication.nativeApplication.exit();, but that’s only really because I assume it’s the most direct way, I’ve never actually tested it against the others!
Kelvin Luck
• Visit Site
February 6th, 2009
I like the following code because it gives the rest of the application the chance to postpone the shutdown to do any housekeeping it needs to:
var exitingEvent:Event = new Event(Event.EXITING, false, true);NativeApplication.nativeApplication.dispatchEvent(exitingEvent);
if (!exitingEvent.isDefaultPrevented()) {
NativeApplication.nativeApplication.exit();
}
Live Preview
Leave a comment