title: as3 if i press opposite movement keys, player stops
body: <p>If I press W and S aka up and down, at the same time. The player stops moving. Can't I make it so which key was pressed last can go towards that way, instead of stopping it all together. So regardless of which keys you press at the same time, the player just moves the way on the key you pressed last. Or if the player lets go of one of the buttons, the button that's still being held functions towards the way. That's how I would want it, but the player would stop all together. Like most games, there is fliud movement where the player wont stop moving unless you let go of all keys.</p>
  
  <p>My code for keyboard movement on keydown:</p>
  
  <pre><code>if (event.keyCode == Keyboard.D)
          {
              isRight = true
          }
          if (event.keyCode == Keyboard.A)
          {
              isLeft = true
          }
          if (event.keyCode == Keyboard.W)
          {
              isUp = true
          }
          if (event.keyCode == Keyboard.S)
          {
              isDown = true
          }
  </code></pre>
  
  <p>In my enterframe:</p>
  
  <pre><code>if (isRight == true)
          {
              x += 5;
          }
          if (isLeft == true )
          {
              x -= 5;
          }
          if (isUp == true)
          {
              y -= 5;
          }
          if (isDown == true)
          {
              y += 5;
          }
  </code></pre>