Effect Demo:
Click here to download the source file
Production steps:
The first step is to run Flash ctrl+j MX, create a new document, and open the Document Properties dialog box, as shown in Figure 1.
In the second step, Ctrl+f8 creates a new movie clip named "Circle," as shown in Figure 2.
The third step, after clicking on the "OK" button, enter the "circle" movie editing status. Select the Ellipse tool, set the wireframe to red, Width 1, no fill color, and draw a positive circle wireframe size 200x200 pixel, as shown in Figure 3.
Step Fourth, ctrl+l open the Library panel, right-click on the Circle movie clip, and select the link command, as shown in Figure 4, Figure 5.
Step fifth, back to the main scene, add the following script in frame 1th:
Set initial variable
R = 50;
n = 180;
i = 0;
Create an empty movie clip MYMC
_root.createemptymovieclip ("MYMC", 1);
With (MYMC) {
Set the coordinates of the MYMC to the center of the stage
This._x = Stage.width/2;//stage.width is the width of the stage
This._y = Stage.height/2;//stage.height is the height of the stage
}
theta = 2*math.pi/n;
Onenterframe = function () {
if (i<=n) {
If I is less than n
coordinates x and y of the ring
x = 2*r*math.cos (I*THETA-MATH.PI/2);
y = R*math.sin (I*THETA-MATH.PI/2);
Set the scale value scale
Scale = MATH.SQRT (x*x);
Load Circle movie clips from the library into MYMC movie clips
Mymc.attachmovie ("Circle", "Circle" +i, i);
With (MYMC) {
Set the coordinates of a ring
Eval ("Circle" +i). _x = x;
Eval ("Circle" +i). _y = y;
Set the proportions of the ring
Eval ("Circle" +i). _xscale = scale;
Eval ("Circle" +i). _yscale = scale;
}
I ++//variable i self-add
} else {
Otherwise, delete your own Onenterframe event.
Delete This.onenterframe;
}
};
Sixth step, save, CTRL + Return test.