Flash make snow effect animation

Source: Internet
Author: User
Tags insert

In fact, this example is already very much! But because a few days ago a snow, and now it is winter! I still look forward to another one ah! So I would like to introduce a friend of the way to make snow. The cartoon feather-like snow long and fall, quite lifelike. This tutorial uses simple as to replicate snowflakes and control their movement to form a snow-heavy effect.

The old rules, first watch animation effect bar!

Click here to download the source file

Here are the steps to make:

1. Open our frequently used Flash MX 2004, create a new Flash document, click the Size button in the Properties panel, and open the document Properties panel to set the scene size to 450px x 240px, Background #00105a, and frame frequency 18fps.

2. Press the shortcut key Ctrl+f8 to open the Create new symbol panel creates a new graphic symbol called snowflakes. Click the Ellipse tool, press SHIFT to pull a 5-pixel circle in the edit scene of the Snowflake component, and then tweak it with the arrow tool to draw a snowflake shape. (Of course you can draw better!) Oh

3. Create a new movie clip symbol named Snowflake Motion, and drag the Snowflake component in the library panel into the scene in that layer. Click on the 40th frame of the Snowflake layer Press the F6 key to insert the keyframe, then right-click Frame 1th to select Create Motion tween, then click Frame 20th and then insert a keyframe.

4. Right-click on the "Snowflake" layer and select the "Add Guide Layer" command from the pop-up menu to create a boot layer for the snowflake layer, as shown in Figure 2. Draw a curve in the guide layer to attach the "snowflake" elements of frames 1th and 40th to the left side of the curve, and the "snowflake" element at the 20th frame is adsorbed at the right end of the curve. The following three graphs illustrate the position of the 1th frame, 20 frames, and 40 frames of snowflakes respectively. (Tips for making tips: if you feel bad adjustment can enlarge the proportion Ah!) Like 400%, 800%, etc! )

5. Back to "Scene 1", drag the "Snowflake movement" component in the library into the scene, click on the 3rd frame and press the F5 key to insert the frame. Click the Snowflake motion component in the scene to take an instance name "Snow" for the movie clip "Snowflake movie" in the Properties panel.

6. Create a new layer in scenario 1, renamed "Action", respectively, click on the 1th, 2, 3 frames in the layer to press F7 key to insert a blank keyframe, you can also change the layer 1 to "snow", press the F9 key to open the "Action" Panel, enter the following code:

The code in frame 1th is as follows:

Variable flakes is used to control the number of snowflakes, that is, density
_visible attribute hides female parent
n = 1;
flakes = 100;
snow._visible = 0;

The code in frame 2nd is as follows:

i = 1;
while (I<=flakes) {
Control the snow falling speed
this["Snow" add i]._y + = Math.random () *2+2;
i++;
}
if (n = = flakes) {
n = 1;
} else {
Math.random () method takes a random number from 0 to 1
Ssize = Math.random () *50+30;
Copy Snowflakes
Duplicatemovieclip ("Snow", "snow" add n, N);
Control the Falling snow
this["Snow" add n]._x = Math.random () *500;
Snowflake Random Transform Size
this["Snow" add N]._xscale = ssize;
this["Snow" add N]._yscale = ssize;
n++;
}

The code in frame 3rd is as follows:

Back to frame 2nd play
gotoAndPlay (2);

The effect is done here. The purpose of this object in code is to refer to a movie clip instance.



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.