I would like to know the correct way to close an AIR application programmatically.
In my Spark WindowedApplication, I have:
this.addEventListener( Event.CLOSING, shutdownApp );
and, of course, the implementation of the shutdownApp method (which basically organizes temporary files).
This is great for the close button to the right of the window. However, I also have functionality that requires shutting down the application. In the code I called:
NativeApplication.nativeApplication.exit();
However, this does not call the Event.CLOSING method, so my temporary files are not cleared. Shouldn't I call nativeApplication.exit? If so, what should I name? I would prefer not to call my shutdownApp method before NativeApplication.exit (), as it does not look so elegant.
Can someone shed some light on the right way to do this?
Thank,
Phil