I'm trying to make the transition between actionscript 2 and 3.
I noticed that the following code makes the object move over 10 pixels on the key-press, then waits a second to make it move more:
Code:
stage.addEventListener(KeyboardEvent.KEY_DOWN, move);
function move(e:KeyboardEvent):void {
if(e.keyCode == 37) {
object.x -= 10
}
}
I want the constant movement to start immediately.
Moreover, the following code is only executed once, instead of every frame like in actionscript 2:
I want it to be executed every frame.
Anyone know how to make it do those two things?