Use the NativeApplication exit() command to shut down an AIR application. Also, if NativeApplication autoExit is true (which is the default), simply closing all the windows will shut down the AIR app.
Sounds good, but I'm new to Air and when I try to do this I keep getting compiler errors. What do I have to import to get this to work. I've tried
I've been using
as the manuals seem to indicate that is where the method is to be found. So a good example would be helpful.
NativeApplication.nativeApplication.exit(); //Small "n" on the second nativeApplication
The reason for this seeming redundancy is that the NativeApplication object is a "singleton" -- only one can exist, and the AIR runtime creates it for you. To access this singleton object, you use the static (aka class) property: nativeApplication. You can then call the non-static (aka instance) method: exit().
and I still get the same compiler error.
I'm sure I'm leaving something out, that is the case 9 time out of 10 when I get this error message. (The other 1 in 10 is spelling errors.) I just don't know what it is, if this was a C/C++ compiler I'd say I had left something out in the Lib path declarations.
Just found what was missing