onClipEvent (load) {
moveSpeed = ~3~;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.~1~)) {
this._~2~+=moveSpeed;
}
}
EXPLAINING:
~1~: this is the key that you press to make the character make. Ex: spacebar, 2 key, G key, etc.
~2~: this is the axis that the object will move on. Y axis is horizontal and X axis is vertical.
~3~: this is the speed that it moves when you press a button. Pretty self-explanatory.
So, in the end, it would look something like this:
onClipEvent (load) {
moveSpeed = 15;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
this._x+=moveSpeed;
}
if (Key.isDown(Key.LEFT)) {
this._x-=moveSpeed;
}
if (Key.isDown(Key.DOWN)) {
this._y+=moveSpeed;
}
if (Key.isDown(Key.UP)) {
this._y-=moveSpeed;
}
}