Why wont this script work as i want to?

Hi. I have a MC linked with AS called char. And the problem is this, the char is supose to walk towards the mouse when i click the mouse. But now the problem is that the MC never stops. It just walks and often in wrong direction.
plz check it out and help me.

var speed = 5;
var aim = “crsSword”;
var Move = false;
attachMovie(“char”, “char”, this.getNextHighestDepth());
attachMovie(aim, “mouseAim”, this.getNextHighestDepth());
movement = function (Move, target, dirX, dirY) {
a = Math.atan2(dirY, dirX);
if (Math.sqrt(Math.pow(dirX, 2)+Math.pow(dirY, 2))>speed) {
target._x += Math.cos(a)*speed;
target._y += Math.sin(a)*speed;
} else if (Math.abs(dirX)>0 && Math.abs(dirY)>0) {
target._x = _root._xmouse;
target._y = _root._ymouse;
}
};
onEnterFrame = function () {
mouseAim._x = _root._xmouse;
mouseAim._y = _root._ymouse;
movement(Move, char, _root._xmouse, _root._ymouse);
};