Close air app, where is it

actionscript-3air

Seems System.exit(0) and flash.system.System.exit(0) both throw the error "[Fault] exception, information=SecurityError: Error #2018: System.exit is only available in the standalone Flash Player."

I'm creating a fullscreen app and im simply want to add a close button that will close all windows and exit (i have a secondary window via NativeWindow open). Tons and tons of googling any nothing. Makes me wonder if im missing something super simple since all "chromless" apps would have to have this.

Poking around I found stage.NativeWindow but closing that does not exit the whole app.

*note I am building and testing in flashdevlop 4.0 with pure as3, no flex.

Best Answer

NativeApplication.nativeApplication.exit();

When in doubt, check the docs! :)

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/desktop/NativeApplication.html#exit()

Related Topic