在键盘中我想同时按下方向键的上键和左键使flash中as2.0的影片剪辑元件能够斜向上移动。不知代码如何写?

2025-03-13 03:38:14
推荐回答(1个)
回答1:

onClipEvent (enterFrame) {
if (Key.isDown(Key.UP)) {
_y -= 5;
}
if (Key.isDown(Key.DOWN)) {
_y += 5;
}
if (Key.isDown(Key.RIGHT)){
_x += 5;
}
if (Key.isDown(Key.LEFT)){
_x -= 5;
}
}