title: 1084: Syntax error: expecting right paren before leftbrace
body: <p>I'm fairly new to action script and I was wondering if any of you guys would be able to solve my problem. </p>
  
  <p>function keyDown (keyEvent:KeyboardEvent):void</p>
  
  <p>{</p>
  
  <pre><code>if (keyEvent.keyCode == Keyboard.D
  {
      rightPressed = true;
  }
  else if (keyEvent.keyCode == Keyboard.A
  {
      leftPressed = true;
  }
  else if (keyEvent.keyCode == Keyboard.S
  {
      downPressed = true;
  }
  else if (keyEvent.keyCode == Keyboard.W
  {
      upPressed = true;
  }   
  </code></pre>
  
  <p>}</p>
  
  <p>I thought the code was fine, however whenever I run it I always get the "1084: Syntax error: expecting right parent before leftbrace" error.</p>