Flash production of the Sky flying Snow visual effects

Source: Internet
Author: User

This example explains the flash production of the Sky Snow's visual effect method. The effect of the tutorial is like a feather-like snow long and falling, quite lifelike. In the example, the snowflakes are copied by the simple as and control their movement, forming the effect of snowing snow. Let's take a look at the effect chart first:

Effect Chart:

1. 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 180px, Background #00105a, and frame frequency 18fps.

2. Press the shortcut key Ctrl+f8 Open the Create new symbol panel new graphic symbol named Snowflake, click the Ellipse tool , press shift in the edit scene of the snowflake component to pull out a circle with a diameter of 5 pixels, and then use the arrow tool With a slight adjustment, the final shape is probably shown in Figure 1.

Figure 1

3. Create a new movie clip symbol named "Snowflake Motion", rename "Layer 1" in its scene to "Snowflake", and drag the "snowflake" component in the library panel into the scene of the 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, in the pop-up menu select the "Add Guide Layer" command for the "snowflake" layer to establish a guide 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. As shown in Figure 3 (this figure is shown in 400%).

Figure 2

Figure 3

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

Figure 4

6. In "Scenario 1", create a new "script" layer, select the 1th, 2, 3 frames in the selected layer, press F7 to insert blank keyframes, as shown in Figure 5, press F9 to open the Actions panel and enter the following code:

Figure 5

The code in frame 1th is as follows:

The code is as follows://variable flakes is used to control the number of snowflakes, i.e. density

_visible attribute hides female parent

n = 1;

flakes = 100;

Snowflakes. _visible = 0;

The code in frame 2nd is as follows:

The code is as follows: i = 1;

while (I<=flakes) {

Control the snow falling speed

this["Snowflake" 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 ("Snowflake", "snowflake" add n, N);

Control the Falling snow

this["Snowflake" Add n]._x = Math.random () *500;

Snowflake Random Transform Size

this["Snowflake" add N]._xscale = ssize;

this["Snowflake" add N]._yscale = ssize;

n++;

}

The code in frame 3rd is as follows:

Code as follows://Return 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.

Above is the flash production of the Sky Snow visual effects, I hope you like this tutorial!

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.