我不断收到“访问未定义属性事件” 似乎无法弄清楚,我猜它是小东西......
private function onkeyboardDown(Event:KeyboardEvent):void
{
switch (event.keyCode)
{
case Keyboard.LEFT:
vx = -5;
break;
case Keyboard.RIGHT:
vx = 5;
break;
case Keyboard.UP:
vy = -5;
break;
case Keyboard.DOWN:
vy = 5;
break;
}
}
Event
!=event
只需将第一个字符串更改为
private function onkeyboardDown(event:KeyboardEvent):void
您没有声明变量 - 事件。可能需要将 Event 重命名为 event。