Flash Tutorial - Controlling a Character/movieclip with Arro

Metacafe Affiliate U
Added by Metacafe Affiliate U Subscribe 925
Published 28 Aug 2008
210
••• More
Report video
0 0
You have already voted for this video.
Here is the actionscript/code for the movieclip to control it, just copy and paste it:

var speed = 5;
...
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;
}
};
Categories: How To
Show moreShow less
Report this video as: