var dy = _ymouse-arrow._y; var dx = _xmouse-arrow._x; this takes y/x values and substracts them to make the legs of a triangle.
var radians = Math.atan2(dy, dx); Arctanget is the opposite of tangent which is triganometry if you dont know it is not a big deal right now. buy it takes the ratio of the values and divides them i believe(not 100% sure) you can also use var radians = Math.atan(dy / dx); and it would be the same. but that make a radian value.
|» Level Intermediate|
Rating: 7.33 Votes: 24
|Started actionscript not even a year ago buy spend my spair time learning it.|
|Download the files used in this tutorial.|
|Download (5 kb)|
|More help? Search our boards for quick answers!|