Copy link to clipboard
Copied
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
Hi,
Event.DEACTIVATE should help you out. Deactivate event does get dispatched when turning the screen off and locking the device.
Regards,
Nimit
Copy link to clipboard
Copied
Hi,
Event.DEACTIVATE should help you out. Deactivate event does get dispatched when turning the screen off and locking the device.
Regards,
Nimit
Copy link to clipboard
Copied
Many thanks, it worked perfectly.
Justin