我一直在“访问未定义的属性事件” 似乎无法弄明白,我猜它的东西很小......
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;
}
}
答案 0 :(得分:2)
Event
!= event
只需将第一个字符串更改为
private function onkeyboardDown(event:KeyboardEvent):void
答案 1 :(得分:0)
您没有声明变量 - 事件。可能需要将事件重命名为事件。