Skip navigation
Currently Being Moderated

NativeApplication.nativeApplication.exit(); problem in iOS app

Mar 4, 2013 9:08 PM

Tags: #ios #action_script_3 #flash_cs6

Have this function called to exit an iOS app:

 

function ExitApp(event:MouseEvent):void {

          listenIO(urAt,0);

          trace('NativeApplication Exit');

          NativeApplication.nativeApplication.exit();

}

 

The function is triggered as the listenIO() does its thing and the trace() triggers, but no exit(). Closing the iOS app by the hardware menu button exits but when re-entering the app, it is stll where it was left and I don't have a function to return to a preset state.

Help to exit the app appreciated, thank you.

 
Replies
  • kglad
    72,166 posts
    Jul 21, 2002
    Currently Being Moderated
    Mar 5, 2013 6:16 AM   in reply to amandasyd

    the exit() method is not supported by iOS.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 5, 2013 6:22 AM   in reply to amandasyd

    One way to get around exit() not working on iOS might be to set the following property in your iPhone section of your app XML:

     

    <iPhone>

              ...

              <key>UIApplicationExitsOnSuspend</key>

              <true/>

              ...

    </iPhone>

     

    That would force your application to exit on suspend (aka the user pressing the hardware button)

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 5, 2013 8:53 AM   in reply to amandasyd

    Try setting NativeApplication.nativeApplication.autoExit = true or false to set it during runtime

     

    Might need to set NativeApplication.nativeApplication.executeInBackground as well - never tried to do this at runtime

     
    |
    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