A special effect animation made by Flash ActionScript

Source: Internet
Author: User
Tags eval

  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.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.