# Delayed keyPress Problem

**URL:** https://forum.kirupa.com/t/delayed-keypress-problem/151767
**Category:** flash
**Created:** [June 17, 2005, 10:47pm UTC](https://forum.kirupa.com/t/delayed-keypress-problem/151767 "2005-06-17T22:47:32Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![RainGame](https://avatars.discourse-cdn.com/v4/letter/r/5fc32e/32.png) [@RainGame](https://forum.kirupa.com/u/RainGame)
#### Post date: [June 17, 2005, 10:47pm UTC](https://forum.kirupa.com/t/delayed-keypress-problem/151767/1 "2005-06-17T22:47:32Z")

</div>

Hi everybody, I’m rather new to ActionScript and I have a quick question concerning a game I’m working on. First off, take a look at my flash so far ( left and right to move, up to jump).

[http://img70.echo.cx/my.php?image=xerav26aj.swf](http://img70.echo.cx/my.php?image=xerav26aj.swf)

As you can see, holding down left or holding down right causes the character to move once, delay, and then move rapidly. Also, once you start moving to the left or right and you jump, you stop moving left or right. This is my code for it -

```auto
on(keyPress "<Left>"){
 if(_root.character_move._x > 25){
  _root.character_move._x -= 5;
 }
}
on(keyPress "<Right>"){
 if(_root.character_move._x < 375){
  _root.character_move._x += 5;
 }
}

```

Is there anyway I can avoid that delay and allow multiple keyPresses? Any help would be greatly appreciated. Thanks, -RainGame

P.S. This is the kind of effect I am trying to create (use spacebar to jump) -  
[http://img272.echo.cx/my.php?image=tut070yh.swf](http://img272.echo.cx/my.php?image=tut070yh.swf)
