ok so i have been trying to detect the mouse angle… kinda figuring it out on my own to learn new stuff and get a better understanding of actionscript, but ive kinda run into a problem i cant figure out.
here is the range of angles i get
0
|
|
90-----90
|
|
0
here is the range i want
90
|
|
180-0
|
|
270
and finally here is my code
_root.onLoad = function(){
var a, b;
var convert;
var ang;
}
_root.onEnterFrame = function(){
xCoord = (_xmouse - 200);
yCoord = (_ymouse - 200)*-1;
calcAngle();
}
_root.calcAngle = function(){
a = Math.abs(xCoord);
b = Math.abs(yCoord);
ang = Math.atan(a/b);
convert = 180/Math.PI;
mouseAngle = ang*convert;
}
any help would be greatly appreciated, thank you