The first line gets the distance between the movie clip on the stage and the mouse position, both x and y, and then calculates the angle of the imaginary line between the movie clip registration point and the mouse position (this details in other tutorials on here as well, so check on them if youre not sure about this) This will be useful in making the movie clip rotate.
The problem with this first line is that it converts the angle into radians, an alternative form of angle measurement to degrees. We need to convert it into degrees if were going to be able to make the movie clip rotate. Thats what the second line of code does.
The next part measures the distance between a) the movie clip registration point and the x position of the mouse, and b) the movie clip registration point and the y position of the mouse, telling us how far away the mouse is from the movie clip.
|» Level Advanced|
Rating: 8 Votes: 88
|Multimedia designer and Flash groupie.|
|Download the files used in this tutorial.|
|Download (10 kb)|
|More help? Search our boards for quick answers!|