OK this is for people who have learnt event handlers and want to move objects
this is very basic
lets say you have a head (of a mapler) and want to move it
the code will be this
- Code:
-
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
_x--;
}
if (Key.isDown(Key.RIGHT)) {
_x++;
}
if (Key.isDown(Key.UP)) {
_y--;
}
if (Key.isDown(Key.DOWN)) {
_y++;
}
}
Explanation:
onClipEvent(enterFrame)
this is the event handler
tells it to execute the following from the { to the last }
lines 2 -4 tells it to move in the direction specified depending on which key is down
the other lines are pretty similar
please comment and inform me of any errors