Fastest way of closing AIR application

Friday, February 6th, 2009
Fastest way of closing AIR application

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

tagged under: ..

ABOUT THIS AUTHOR

Get a Trackback link

2 Comments


  1. 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!


  2. 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

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

CommentLuv Enabled

Images is enhanced with WordPress Lightbox JS by Zeo