IOS AIR app still running when the iphone is locked?

此生再无相见时 提交于 2019-12-25 02:05:59

问题


I just made a simple game with flash professional 6.0 and the adobe AIR 4.4 SDK for iPhone.

The problem is that when I lock the iphone pressing the power button, the screen switches off as usual, but the music of the game still sounds. If I exit the game pressing the home button it exits fine. Is only when locking the phone with the app opened.


回答1:


Try add listeners for the events Event.DEACTIVATE on your main class and Event.EXITING on NativeApplication.nativeApplication.

On the events handlers you can do what you want to stop / pause your game.

Add a listener to the event Event.ACTIVATE on the main class to resume the game.



来源:https://stackoverflow.com/questions/22368789/ios-air-app-still-running-when-the-iphone-is-locked

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!