First time here? First time here? Newsletter Signup Newsletter
Login | Register | 651326 Members and growing!
Search tutorials

<- A "sine wave" (for the remainder of this tutorial I will refer to sine by it's common abbreviation "sin".

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).
You multiply by PI/180 to convert to radians.

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.

» Level Intermediate

Added: 2004-09-12
Rating: 4 Votes: 39
(10 being the highest)
» Author
Please visit my site and/or email me if you want more tutorials from me!
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!


  • There are no comments yet. Be the first to comment!

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: Inocreato
» Title: RaiseTheBlocks
» Description: Raise all the blocks to win the game
Featured Sound Loops
Image for equalize

Audio Player

» Author: TomCat Carty
» Title: The Wood
» Description: Just a little game ending or it can maybe be looped. Recorders with music box and percussion to give the feel of well, I don't know, the woods? Free to use, just credit me. thank you
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: Davisigner
» Description: Hmm... what to say about this one? It's reminiscent of the closing notes of the opening music from the Three Stooges done in a church organ style with a closing cymbal crash. I'll give this one away gratis, but feel free to check out my free loops and potential upcoming license-mandated ones over in the respective part of Flashkit.