My code looks like so:
It has some more bells and whistles to it but this is the important part.Actionscript Code:onClipEvent (enterFrame) {
xdiff = this._x-_root.cursor._x;
ydiff = this._y-_root.cursor._y;
hyp = Math.sqrt(Math.pow(xdiff, 2)+Math.pow(ydiff, 2));
phi = (180/Math.PI)*Math.asin(ydiff/hyp);
if (xdiff>0) {
phi = 90-phi;
this._rotation -= (0.1)*(this._rotation+phi);
} else if (xdiff<0) {
phi = phi-90;
this._rotation -= (0.1)*(this._rotation+phi);
}
}




Reply With Quote
