OK, time for some duplication. Ready?
1. What we need to change
First of all, we will have to duplicate that dot of ours, and make them all move, so the last line of the previous code
dot.onEnterFrame=rotate;
should be included in a loop to make all the dots move.
Then the variables that depend on the dot that we declared first should be declared inside the loop because each duplicated dot has its own variables.
2. The code now
The variables declaration
anglespeed = Math.PI/24;
perspective = 300;
tilt = 5;
centerx=200;
maxClip=50;
I’ve just added a maxClip variable that will tell the total amount of dots that you want.
The function remains the same.
The loop that duplicates our dots
for (var i=0;i < maxClip;i++){
mc=dot.duplicateMovieClip("dot"+i,i);
mc.angle=0;
mc.radius=50;
mc.starty=5*i;
mc.onEnterFrame=rotate;
}
This is where we have to be good to have a good effect. If you don’t understand that code, check the AS tricks section, most of it is explained there.
You can see here that all the duplicated clips have the same starting angle angle, the same radius radius, but a different starting point on the _y axis starty. Then we assign the rotate function to the duplicate.
3. Small improvement
If you test the code now, you’ll see that the first dot is still visible. To solve that little problem, simply add this line at the bottom of the code:
dot._visible=0;
End of Part Deux. Everything OK?
pom :asian: