вот ваш код на as2.0
Код
stop();
var mSpeed=5;
player.onEnterFrame=function() {
if (Key.isDown(Key.LEFT)) this._x -= mSpeed;
if (Key.isDown(Key.RIGHT)) this._x += mSpeed;
if (Key.isDown(Key.UP)) this._y -= mSpeed;
if (Key.isDown(Key.DOWN)) this._y += mSpeed;
}
и код на AS 3.0
Код
import flash.display.MovieClip;
import flash.events.KeyboardEvent;
import flash.ui.Keyboard;
stage.addEventListener(KeyboardEvent.KEY_UP, f);
function f(e:KeyboardEvent):void {trace(test);
switch(e.keyCode) {
case Keyboard.RIGHT:
test.x += 10;
break;
case Keyboard.DOWN:
test.y += 10;
break;
case Keyboard.LEFT:
test.x -= 10;
break;
case Keyboard.UP:
test.y -= 10;
break;
}
}
если правильно перемещаем клип test