Handling activation and deactivation


show more Handling activation and deactivation provides you with in-depth training on Developer. Taught by Paul Trani as part of the Flash Professional CS5: Creating a Simple Game for Android Devices show less
please wait ...

Handling activation and deactivation

Since this is a game for mobile devices, what we need to do is figure out how to handle the game, say for instance, when the user gets a phone call, or when the user launches another app. So we need to handle this activation and deactivation of this game, and I'm going to do that by using the Code Snippets panel. Down here there is App Activate/Deactivate. So I'm going to go ahead and that to that frame on my Actions layer where all my other code is, right in here.

So there's a couple of EventListeners right in here. So the first one is going to listen for the deactivate, so anytime you know, say for instance, when the user gets a phone call or launches another app, and this app is actually basically in background mode. What we do with everything? Well, what we do with that information is we're going to go ahead and pause the game anytime the game is deactivated or running in the background.

We want to pause it because not only do we not want the game to continue to play an...

Handling activation and deactivation
Video duration: 6m 14s 3h 35m Intermediate

Viewers:

Handling activation and deactivation provides you with in-depth training on Developer. Taught by Paul Trani as part of the Flash Professional CS5: Creating a Simple Game for Android Devices

please wait ...