title: How to make my character move relative to the mouse position with actionscript 3?
body: <p>ok so i have a character called character_mc and i want it to move towards the mouse when you press the forward arrow and strafe relative to right angles of that.</p>
  
  <p>i am quite new to actionscript so could you please include and example of your code in my original code</p>
  
  <p>Here is my current code:</p>
  
  <pre><code>import flash.events.MouseEvent;
  //Event Listners
  stage.addChild(crosshair_mc);
  crosshair_mc.mouseEnabled = false;
  crosshair_mc.addEventListener(Event.ENTER_FRAME, fl_CustomMouseCursor);
  
  function fl_CustomMouseCursor(event:Event)
  {
      crosshair_mc.x = stage.mouseX;
      crosshair_mc.y = stage.mouseY;
  }
  Mouse.hide();
  
  stage.addEventListener(MouseEvent.MOUSE_MOVE,facecursor);
  stage.addEventListener(KeyboardEvent.KEY_DOWN, fl_KeyboardDownHandler);
  //Functions
  function facecursor(event):void
  {
      character_mc.rotation = (180 * Math.atan2(mouseY - character_mc.y,mouseX - character_mc.x))/Math.PI + 90;
  
  }
  
  
  function fl_KeyboardDownHandler(event:KeyboardEvent):void
  {
      trace("Key Code Pressed: " + event.keyCode);
      if (event.keyCode == 38)
      {
          character_mc.y = character_mc.y - 5;
      }
      if (event.keyCode == 40)
      {
          character_mc.y = character_mc.y + 5;
      }
          if (event.keyCode == 39)
      {
          character_mc.x = character_mc.x + 5;
      }
          if (event.keyCode == 37)
      {
          character_mc.x = character_mc.x - 5;
      }
  
  }
  </code></pre>