Search Tutorials
Well, Macromedia flash has this mathmatical function all nicely coded up for you (TRUST ME, we don't want to start working with the power series that is used in the calculation of sin). Sin works by taking in a parameter and giving back a number between -1 and 1. As we tell it where on the X-axis we want current Y. For math haters: this simply means we read the wave from left to right, each position has a particular number, at each given position, the sin function tells us where to put the ball. So, let's lay out the dots. What we want to do first is actually graph out the sin wave. We can do this by asking the sin function how high (between -1 and 1) should each ball be. But between -1 and 1 is a small small graph! So let's scale it by a variable factor. This way we can increase the size at a whim. Increment the x-axis value and then call the corrisponding Y axis value as the sin(someStartValue + x * PI/180). This will give us the sin wave, made up of the balls we have supplied. If you don't know how to do duplication of movie clips, you must first get the hang of that, and basic flash programming before truly understanding this system in the code sense, but anyone should understand how it works in a hypothetical sense.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|