How do I have my app automatically reset on exit. I can do it when someone presses an exit button, but on mobile phones people just press the home button and the app saves state.
I want to reset a concentration style game since it is timed and wouldn't be fair to pause the game and come back later.
the NativeApplication class has an Event.USER_IDLE event you can use to detect when (and for how long using Event.USER_PRESENT) your app has been idled.
and, you can prevent idle mode (on some systems) by using
NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.KEEP_AWAKE;
in any case, check the NativeApplication class for all sorts of things you can do to control how your app behaves and is behaving when it's running.
I have used these lines:
private function exiting(e:Event):void
textBox.text = "Shake!";
application.systemIdleMode = SystemIdleMode.NORMAL;
But it doesn't put the words back in the text box.
application = NativeApplication.nativeApplication;
application.systemIdleMode = SystemIdleMode.KEEP_AWAKE;