Last active
August 29, 2015 14:17
-
-
Save marchbold/84a02160905e5e4a0a1d to your computer and use it in GitHub Desktop.
Determine if the user deactivated your app via the home or lock button
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Application.init( APPLICATION_KEY ); | |
if (Application.isSupported) | |
{ | |
Application.service.addEventListener( ApplicationStateEvent.DEACTIVATE, application_deactivateHandler ); | |
} | |
function application_deactivateHandler( event:ApplicationStateEvent ):void | |
{ | |
switch (event.code) | |
{ | |
case ApplicationStateEvent.CODE_HOME: | |
// home button was pressed | |
break; | |
case ApplicationStateEvent.CODE_LOCK: | |
// lock button was pressed | |
break; | |
} | |
} | |
// com.distriqt.Application |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://airnativeextensions.com/extension/com.distriqt.Application