I am designing a game in Haxe NME using Flashdevelop. I have an object on the screen and I want it to rotate to follow the mouse as the mouse moves. I have the object rotating at the same speed as the mouse, but it doesn't point towards the mouse. It's like there is a phantom mouse on the screen that moves whenever my mouse moves.

This is the code that gets called whenever the mouse changes positon:

```
public function mouseProcess(e:MouseEvent) 
{
    var Xdistance:Float = e.localX - survivor.x;
    var Ydistance:Float = e.localY - survivor.y;
    survivor.rotation = Math.atan2(Ydistance, Xdistance) * 180 / Math.PI;
}

```

`e.localX/Y` gets the current x,y position of the mouse and the survivor. x/y gets the x,y position of the object that needs to rotate.

Thanks