JapanMan
February 5th, 2009, 08:40 PM
Can someone please post a good way to rotate something to match the mouse? I know it has something to do with the Pythagorean Theorem and sin/cos/tan and MC._rotation, but I'm not sure how to put 2 and 2 together. Using "mcA" and "mcB" (its arms/rotating-thing), this is as far as I can get:
onClipEvent(load){
this.onEnterFrame = function() {
rotateArms();
};
function rotateArms() {
mcA.mcB._rotation = math.tan((_ymouse-this._y)/(_xmouse-this._x));
}
}Thanks.
onClipEvent(load){
this.onEnterFrame = function() {
rotateArms();
};
function rotateArms() {
mcA.mcB._rotation = math.tan((_ymouse-this._y)/(_xmouse-this._x));
}
}Thanks.