
Flash tutorial - controlling a character/movieclip with arro
Here is the actionscript/code for the movieclip to control it, just copy and paste it:
var speed = 5;
this.onEnterFrame = function() {
if (Key.isDown(Key.UP)) {
square._y -= speed;
}
if (Key.isDown(Key.DOWN)) {
square._y += speed;
}
if (Key.isDown(Key.LEFT)) {
square._x -= speed;
}
if (Key.isDown(Key.RIGHT)) {
square._x += speed;
}
};
