12 Replies Latest reply: Jun 25, 2009 6:04 PM by Ned Murphy RSS

    Switch case trouble... it looks fine but output says otherwise

    the_missing_link Community Member

      Hi;

      I'm hoping someone can be kind enough to help me with my annoying switch case problem that I've been staring at for hours with very little succsess.

      function cool(event:KeyboardEvent):void

      {
      switch(event.keyCode)
      {
       case  Keyboard.LEFT : shoot_mc.x -= 5
       break;
       case  Keyboard.RIGHT : shoot_mc.x += 5
       break;
       case Keyboard.UP : shoot_mc.y += 5
       break;
       case Keyboard.DOWN : shoot_mc.y -= 5
       break;
      }
       }