下面的代碼會引發錯誤1046:未找到類型或不是編譯時常量:KeyboardEvent。Adobe Air - KeyboardEvent錯誤
有人知道爲什麼嗎?
import flash.desktop.NativeApplication;
import flash.desktop.SystemIdleMode;
import flash.system.Capabilities;
import flash.system.System;
if (Capabilities.cpuArchitecture == "ARM")
{
NativeApplication.nativeApplication.addEventListener(KeyboardEvent.KEY_DOWN, handleKeys, false, 0, true);
}
function handleKeys(event:KeyboardEvent):void
{
if (event.keyCode == Keyboard.BACK)
{
NativeApplication.nativeApplication.exit();
}
}
如果答案解決您的問題(如你在給你對此有何評論表示),請接受的答案。謝謝。 – CodeMouse92 2012-04-29 03:02:19