A relatively straightforward use of the Duplicate Movie Clip Action. You could use something like this to keep visitors amused while your main movie loads.
Start a new movie.
Begin by making a simple shape. I made a star, but it doesn't really matter
what it is...
Select the shape, and press F8 to convert it into a Movie symbol - call it Star.
Double-click on the instance of the movie on the stage (not the one in the Library
box) to bring up its properties. Give it an instance name of Star1. You might
use a different name, but make sure there's a 1 at the end... you'll see why
later.

Add another layer to the timeline and create 3 keyframes in it (see illustration).
Make sure there are 3 frames in the layer containing the movie clip (labelled
here as 'Graphics'), or your graphics will disappear when you run the movie.

Double-click each of the 3 keyframes in turn to bring up their properties and
put in the ActionScript shown on below.
It is important in doing this that you make correct use of the 'abc/=' button
in the Actions tab: don't get your Expressions mixed up with your String Literals!
| KeyFrame 1: Start Drag ("Star1", lockcenter) KeyFrame 2: Set Variable: "CopyCount" = CopyCount+1 If (CopyCount>10) Set Variable: "CopyCount" = 1 End If Duplicate Movie Clip ("Star1", "Star" & CopyCount, CopyCount) Set Property ("Star" & CopyCount, Rotation) = Random(72) KeyFrame 3: Go to and Play (2) |
Here's the ActionScript from the 2nd Keyframe again: this is the important one!
The variable CopyCount increases by 1 each time the movie loops. When it reaches
10, it is set back to 1, and so loops around again.
The last line makes a duplicate of the original movie clip (Star1), and calls
it Star2 or Star3 or Star4 etc., depending on the value of CopyCount.
When CopyCount goes back to 1, it 'overwrites' the original Star1, then Star2,
and so on. In this way, there are only ever 10 movie clips.

As a finishing touch, add an extra line which rotates the current movie clip randomly, just for a bit of variety. Since my shape has 5-fold symmetry, I use a random value between 1 and 72.
If you use a different shape, you may wish to use a value of 360 instead (or not bother with the rotation at all).

Here's the result.
Download Source


