The SWF File
Creating a Sine and Cosine object is simple. The output works by setting the frame of a submovie to the angle you want, and then reading the _X value (sine at angle) and the _Y (cosine at angle) of a reference point.
Getting Started
To start, you should set the grid to a multiple of ten. 100 or 10 works great. Turn on snap and the grid.
Now, You need to create a Reference Object. A circle works quite nicely. Leave the fill in, as it will help with centering later.

Sine and Cosine
Highlight the fill and press F8. Create a symbol named "Reference Point", make sure to make it a sub-movie
We now have a point that will serve as the sine and cosine look up. Now here is where the hack comes in. Sine and Cosine works on a curve¡ and if you Graph (Sine(theta),Cosine(theta)) where theta = 0 to 2pi, you get a circle. Where Theta = 0, you get (0,1). This is convient for us. So how do we get this to work this way? Motion Tweening with a circle guide path.
Now¡ The Guide point needs to be moved out of the way. I put it at (0,-50)
We need a motion guide. Click right on "Layer 1", and select "Add motion guide"

Creating The Circle
You will now have a layer to place the path for the table. Draw a Perfectly round circle on the guide path layer. And elipse will not work. I use the dimensions (-50,-50)-(50,50).
Now we have a path that it will move, and the object that will be moving. We now need to create some frames so it will acually have time to tween, and create some new keyframes. I fill both layers up to frame 21, and add new keyframes at 11 and 21 on the REFERENCE POINT layer.
We now need to tell flash that we want it to tween, click right on the first and second keyframes, clicking the tween tab and setting "tweening" to "Motion"
Frames 1-20 should now be purple on the reference point layer.Now¡ we need to get it to rotate around the circle. On frames 1 and 21, the reference point should be at the top of the circle. If you used the out of the way position for it like I did, it should already be there. Now, select the reference point on frame 11. Move it to the bottom of the circle
Finishing Touches
Feel free to preview the movie¡ it should rotate around the circle. Now, we have a problem¡ it rotates in the wrong direction! This is an easy fix¡ we just have to make sure that it doesn¡¯t have a path to rotate the wrong direction on. Select the guide path layer, and draw a line from the top point of the circle to the bottom. Now, create a keyframe on the 11th frame of the guide layer
Now¡ go back to the first keyframe on the guide layer, and delete the left half of the circle, then the vertical line.
Now, go to the second keyframe on the guide layer, and delete the right half of the circle then the vertical line. You now have a sine and cosine table. Remember, you need to have the same number of frames between the 2 halves of the circle¡ otherwise the table produces bad values. You also want to have one more frame than you want angle points¡ IE: if you want to have 360 angles¡ you would want 361 frames, because the last frame is the same thing as the first frame. It is recommended that you place the table in an independent object.
discuss this topic to forum
