Ok, this has had me stumped. I know next to nothing in Actionscript, and I've been surfing looking for examples. Every script I have tried just doesn't move anything. So I was wondering if I could get you guys to help me.
I'll post what I have right now. I know there are some obvious mistakes, but it's just because I've been fiddling with brackets etc. to see if I can get it to work. So don't laugh at my ineptitude
onClipEvent(enterFrame){
_global.radiansToDegrees = function (radians)
{
return (radians/Math.PI) * 180;
}
MovieClip.prototype.rotateTowardsMouse = function () {
var point = {x:this._x, y:this._y};
this._parent.localToGlobal(point);
var deltaX = _root._xmouse - point.x;
var deltaY = _root._ymouse - point.y;
var rotationRadian = Math.atan2(deltaY, deltaX);
var rotationAngle = radiansToDegrees(rotationRadian); // See earlier function
this._rotation = rotationAngle;
}
Arm.onEnterFrame=rotateTowardsMouse;
}
Yeah, even I know a few of those brackets are completely randomly placed.
So, if anyone can help, it would be much appreciated.
If it makes a difference, this movie clip is pointing to the left and I want it to rotate at the right side.
Thanks in advance,
Another confused first-post newbie
