Tutorials Home
What's New
Top Rated
Submit
myTutes
Random!
Making movieclips point at the mouse
Author: Ozzy Greyman
| Website: www.freewebs.com/ozzygreyman |
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 |
|
|
Added: : 2008-05-05
Rating: 8.16 Votes: 20
Hits: 2094
|
| » Author |
|
Started actionscript not even a year ago buy spend my spair time learning it.
|
| » Download |
|
Download the files used in this tutorial.
|
|
Download (5 kb)
|
|
Get conversion and unzipping tools
for PC and Mac here!
|
| » Forums |
|
More help? Search our boards for quick answers!
|
|
Please rate this tutorial, 10 is the top rating, you can also click the
comments link to read/write a review.
|
|
|