var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
if (Key.getCode() == 37) {
//do something here for space bar pressLeft: 37 Up: 38 Right: 39
//Down: 40
a1._x -= 10;
t1.text = a1._x;
if (a1._x>380) {
gotoAndPlay("Scene 2", 1);
}
}
if (Key.getCode() == 39) {
a1._x += 10;
t1.text = a1._x;
if (a1._x>380) {
gotoAndPlay("Scene 2", 1);
}
}
if (Key.getCode() == 38) {
a1._y -= 10;
}
if (Key.getCode() == 40) {
a1._y += 10;
}
};
Key.addListener(keyListener);
ไม่มีความคิดเห็น:
แสดงความคิดเห็น