Search code examples
actionscript-3air

AS3 stage.Activate and stage.deactivate works for user click on the iPad home button?


I would like to detect the user tap the home button the quit the app, and come back to the app . is stage.activate and stage.deactivate works?

stage.addEventListener(Event.ACTIVATE,volRestore);
stage.addEventListener(Event.DEACTIVATE,volFade);

Cheers Bill


Solution

  • Yes, those are the correct Events to listen for - on mobile, the app wont actually exit, it will just 'freeze' when user 'closes' it.

    Not sure if you need to attach to Stage though - "this" should suffice - assuming your code is in top level of app.