Exit Android App with external *actionscript.as* files
Hi, i'm trying to make this code work with a application that got 99% of code driving by external actionscript.as files;
In another app without any external call i mean no actionscript.as files, the code work very fine.
My goal is to shutdown any activity of the app when the user receive a call or something like that;
Many thanks in advance and sorry my english ![]()
Scene 1, Layer 'Layer 1', Frame 1, Line 14
1046: Type was not found or was not a compile-time constant: KeyboardEvent.
function handleActivate(event:Event):void
{
NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.KEEP_AWAKE;
}
function handleDeactivate(event:Event):void
{
NativeApplication.nativeApplication.exit();
}
function handleKeys(event:KeyboardEvent):void ----- Line 14 -----
{
if (event.keyCode == Keyboard.BACK)
{
NativeApplication.nativeApplication.exit();
}
}
if (Capabilities.cpuArchitecture == "ARM")
{
NativeApplication.nativeApplication.addEventListener(Event.ACTIVATE, handleActivate, false, 0, true);
NativeApplication.nativeApplication.addEventListener(Event.DEACTIVATE, handleDeactivate, false, 0, true);
NativeApplication.nativeApplication.addEventListener(KeyboardEvent.KEY_DOWN, handleKeys, false, 0, true);
}
