brainpudding
Technical User
ok Mr Bill Watson worked this code up for me and it works.. but i have tried tweaking the numbers but i cant get it to work acuratley. what this does is makes a movie clip of a gun that sits in the bottom right hand corner of a 750X450 movie rotate with the cursor .. so the gun is pointing where the cursor is.
gun.onMouseMove = function(){
temp1 = _xmouse;
temp2 = _ymouse;
wildGuess = 30;
len = (650-temp1)*(650-temp1)+(311-temp2)*(311-temp2)
hyp = Math.sqrt(len);
len2 = (650-temp1)/hyp;
angle = Math.sin(len2);
this._rotation = -angle*wildGuess;
}
that works but it dosent follow accuratley
any one have suggestions on tweaking it?
gun.onMouseMove = function(){
temp1 = _xmouse;
temp2 = _ymouse;
wildGuess = 30;
len = (650-temp1)*(650-temp1)+(311-temp2)*(311-temp2)
hyp = Math.sqrt(len);
len2 = (650-temp1)/hyp;
angle = Math.sin(len2);
this._rotation = -angle*wildGuess;
}
that works but it dosent follow accuratley
any one have suggestions on tweaking it?