As3: keyBoard eventListener working slow
Hello mates,
I am trying to move an object on stage with arrow keys. I am using this code
Actionscript Code:
stage.addEventListener(KeyboardEvent.KEY_DOWN, moveCatcher);
function moveCatcher(event:KeyboardEvent):void {
if(event.keyCode == Keyboard.LEFT && catcher.x >= 0)
catcher.x -=8;
else if(event.keyCode == Keyboard.RIGHT && catcher.x < 600)
catcher.x +=8;
}
The problem is that it do not start to move immediately after I press the key and it takes few moments to move. I have uploaded the swf file here http://www.evaic.com/catcher202kkles...oqwnlssewe.swf
Please suggest some solution if you figured out the problem,
Regards :)