Skip to main content
Known Participant
Apr 27, 2013 10:12 AM UTC
Answered

Sleep mode Android still running

Dear developers, I have a small problem with a game I am developing for Android/IOS.  I am testing it out on a Samsumg Galaxy Tab II 10.1 and have the following behaviour.

When I press the power button to enter sleep mode with the app playing, after the screen goes black I can continue to hear game sounds from the tablet (even 30 seconds after pressing the power button).  When I turn it back on, it is clear that the game play has moved forward (at a lower frame rate, as the link below suggests).  Is this expected behaviour?

http://help.adobe.com/en_US/as3/mobile/WS4bebcd66a74275c36cfb8137124318eebc6-8000.html

My question is "What line of code do I use to detect when the screen goes black?"  When I receive this trigger I would then force the game to go into a pause mode (which I have already coded for anyways).

Thank you

This topic is closed to new replies. Start a new post to keep the conversation going.
nimitjaCorrect answer
Adobe Employee
Apr 27, 2013 1:56 PM UTC

Hi,

Event.DEACTIVATE should help you out. Deactivate event does get dispatched when turning the screen off and locking the device.

Regards,

Nimit

2 replies

nimitjaCorrect answer
Adobe Employee
Apr 27, 2013 1:56 PM UTC

Hi,

Event.DEACTIVATE should help you out. Deactivate event does get dispatched when turning the screen off and locking the device.

Regards,

Nimit

Translate
Known Participant
Apr 27, 2013 7:52 PM UTC

Many thanks, it worked perfectly.

Justin

Translate