Rotation problems

Okie-dokie, more problems in Flash MX land.

Another tough one for you guys… check out the attached file. Don’t ask me why, but I need that yellow rectangle to follow that grey dot, which rotates around randomly… but see, if you place the dot to the center left of the grey rectangle, you see that the yellow rectangle screws up.

I’ve deducted that this happens for this reason: to the left of the grey rectangle, the rotation value is 178… 179… 180… then it jumps to -180… -179… -178… (you can try this out using an onEnterFrame function and tracing the rotation of an object that follows the mouse). Since the yellow rectangle follows the grey dot with an ease, it doesn’t just do:
rectangle._rotation = dot._rotation
But instead:
*rectangle._rotation += Math.round((dot._rotation-this._rotation)/rotatespeed)
*Some of you guys should already be familiar with this kind of movement, but it’s usually used to move objects smoothly. The bug here is that whenever that dot randomly jumps up into -180 from it’s original position at below 180, it screws up the yellow rectangle.

This is very hard to explain, that’s why I included the example. I really hope you can help!

Thanks in advance,
-Raven~Storm