Skip navigation
Currently Being Moderated

Reset app on exit

Nov 23, 2012 10:03 PM

Tags: #air #as3 #mobile #ios #flash_cs6

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.

 

Thanks.

 
Replies
  • kglad
    72,212 posts
    Jul 21, 2002
    Currently Being Moderated
    Nov 24, 2012 7:29 AM   in reply to soremite

    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.

     
    |
    Mark as:
  • kglad
    72,212 posts
    Jul 21, 2002
    Currently Being Moderated
    Nov 25, 2012 12:13 AM   in reply to soremite

    where is application defined?  (and, unless it's defined as NativeApplication.nativeApplication, it's wrong.)

     
    |
    Mark as:
  • kglad
    72,212 posts
    Jul 21, 2002
    Currently Being Moderated
    Nov 25, 2012 7:16 AM   in reply to soremite

    great.

     

    please mark helpful/correct responses.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points