Android : Actionscript 3 Android Device 'Back' Key

on Monday, November 3, 2014


This is the code I have for a Android device BACK button:



function handleKeyOut(event:KeyboardEvent):void
{
if (event.keyCode == Keyboard.BACK)
{
event.preventDefault();
gotoAndStop(2);
}
}


When I test the code on my Samsung Galaxy Mega 6.3 phone (Kit Kat), hitting the BACK key button causes the app to not show on the screen yet still run in the background. My app does have a frame 2...Flash debugger gives no errors so I'm thinking maybe it's Kit Kat (since I've had sound issues with Kit Kat already).


I would like for the BACK key to take the user to frame 2. If I code a 'Native Application Exit' for the BACK key it works fine...the BACK key just won't accept the gotoAndStop command.


I'm researching this now so thanks if anyone can put some insight into this.


0 comments:

Post a Comment