Tricky as hell.

this is what i've go so far.

onClipEvent (load) {
ease = 12;
function TurretRotation () {
var MTdistX = _root._xmouse - this._x;
var MTdistY = _root._ymouse - this._y;
var MTdist = Math.sqrt((MTdistX*MTdistX)+(MTdistY*MTdistY));
var TargetTheta = Math.atan(MTdistY/MTdistX);
if (MTdistX > 0) {
RotationEase = ((TargetTheta*(180/Math.PI)-90)-_rotation)/ease;
return RotationEase;
} else {
RotationEase = ((TargetTheta*(180/Math.PI)+90)-_rotation)/ease;
return RotationEase;
}
}
function setxy () {
this._x = _root.tank._x;
this._y = _root.tank._y;
}
}
onClipEvent (enterFrame) {
_rotation += TurretRotation ();
setxy ();
}
this code works GREAT! it eases in nicely like i want it to, and it goes right to the mouse where ever it is on the screen. BUT! since the rotations go (in a circle) 0 to 90 to 180 to 270 to 360/0 when i cross over that 360/0 line at the top, it my turret goes all the way around the opposite direction to get the 1 deggree of where it was, instead of going that 1 deggree....i've tried a couple of tricky things, but if someone could help me, i'd really appreciate it. Mash and mame my code all you want, write your own! i really don't care, just solve my problems for me :-)

-Thanks