Rotational

All right. I’d like to add a movement easing script to a movie clip that rotates toward the mouse constantly. Here’s the script on a controller movie clip (I know that’s old-fashioned):

//variables are angle, x, y, and r
//x and y are the mouse's relative coordinates (legs)
//angle is the rotation of the gun (hypotenuse angle)
//_parent.turret is the rotating movie clip
onClipEvent (enterFrame) {
	x = this._xmouse;
	y = this._ymouse*-1;
	//monitor the coordinates of the mouse
	this.angle = Math.atan(y/x)/(Math.PI/180);
	//calculate the mouse's angle (as opposed to the turret's angle)
	if (x<0) {
		this.angle += 180;
	}
	if (x>=0 and y<0) {
		this.angle += 360;
	}
	//make sure the angle stays below 360
	_parent.turret._rotation = (this.angle*-1);
	//point the turret in the direction of the mouse
	updateAfterEvent();
}

I’d like that line <<_parent.turret._rotation = (this.angle*-1);>> to instead smooth the movement (That is, go half the distance each frame) . . . but upon adding the traditional code (which can also be found somewhere on kirupa), when I cross the mouse from, say 359 degrees to 1 degree, the accursed thing spins the opposite direction. I understand why this happens, but have no thoughts as to how to fix it. It has baffled me for some time.

I’ll attach the .fla in case the above is too cryptic, but keep in mind that there are some other features since added, like firing bullets and such. Ignore the actions concerning these; the only important code is on an empty mC called script. It’s inside the motoGun mC, at 0x0. Can anyone help?