Copy link to clipboard
Copied
Hi I have made flash android game, here is issue is, client need a button to close this game, and other option is if user clicks on home botton on tab/Ipad then game must be pause,
right now if user minimise the app it's sound still playing and everything working as it is. How can I capture that user that user minimise the app.
Thanks for reply kglad,
I already read this before posting this issue, this is not mention on any official page of adobe, but I did it,
I close app on pressing back key and home key,
NativeApplication.nativeApplication.addEventListener(Event.DEACTIVATE,gameclose) << on pressing homekey
NativeApplication.nativeApplication.addEventListener(KeyboardEvent.KEY_DOWN, handleKeys) <<on pressing back arrow key
private function gameclose(event:Event):void{
NativeApplication.nativeApplication.exit();
}
priv
...Copy link to clipboard
Copied
Copy link to clipboard
Copied
Thanks for reply kglad,
I already read this before posting this issue, this is not mention on any official page of adobe, but I did it,
I close app on pressing back key and home key,
NativeApplication.nativeApplication.addEventListener(Event.DEACTIVATE,gameclose) << on pressing homekey
NativeApplication.nativeApplication.addEventListener(KeyboardEvent.KEY_DOWN, handleKeys) <<on pressing back arrow key
private function gameclose(event:Event):void{
NativeApplication.nativeApplication.exit();
}
private function handleKeys(event:KeyboardEvent):void{
if(event.keyCode == Keyboard.BACK)
NativeApplication.nativeApplication.exit();
}
Copy link to clipboard
Copied
both of those events are suggested in the adobe link i posted.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now