Flash Ationscrip 3.0 Create lifelike snow GIF animation effect

Source: Internet
Author: User
Tags addchild time interval

This example for the use of Flash Ationscrip 3.0 to make lifelike snow gif animation effect tutorial, often from the online animation to see the scene of snow, see snowflakes from the sky dragged down, there really is a kind of immersive feeling it? But the main is made of Ationscrip 2.0, Now we use Ationscrip 3.0来 to make snow effects.

Effect Demo:

  First, the production of snowflake components

1, open Flash9.0, new Flash document selection Ationscrip 3.0. The background color is dark blue, the stage size is 550x400. Then press Ctrl+f8 to create a new movie clip symbol "Snowflake", after entering the Snowflake component edit state, Layer 1 is changed to "snowflake layer" with an elliptical tool to drag a roughly 2x2 pixel-free pure white circle on the stage, then zoom to 800%, with the selection tool at the edge of the random pull, Make it into an irregular shape, and finally Select this graphic, open modify-shape-soft fill edge, bring up the Soft Fill Edge dialog box, fill in the distance item with 5px, "Step number" is 5, "direction" is "extended", and the dimensions are approximately 7.5x7 pixels when finished. Select the right key to the movie clip symbol "Static snowflake". As shown in Figure 1 (magnified to 800% effect).

2. Insert the keyframe on the 80th frame of the snowflake layer layer of the movie clip, then "Add the Motion Guide layer" on the second layer, the stage shrinks to 50%, draw a motion line from top to bottom with pencil drawing, insert frame at frame 80th, lock. Select the snowflake layer to create a tweened animation by selecting the "Static Snowflake" component on frame 80th of the snowflake layer diagram and dragging it to the lower end of the motion line. As shown in Figure 2

Then right click on the "Snowflake" component in the library, select the "link" item and add the identifier to "XH_MC".

WEBJX Core Tip: This example for the use of Flash Ationscrip 3.0 Snow snow effect, often from the online animation to see the scene of the snow, see snowflakes from the sky dragged down, there really is a kind of immersive feeling it? But mainly with the Ationscrip 2.0 production, Now we use Ationscrip 3.0来 to make snow effects.

  Second, the production background

Back in Scenario 1, select "File"-"Import"-"Import to Stage", choose a snow image from your disk, select the picture, set it to 550x400, center it, and change the layer 1 to "background."

Third, create a new layer "as", point 1th frame, open the Actions panel, add the following code:

The code is as follows:

Var sj:timer=new Timer (Math.random () *300+100,100);

Declare a time variable, type timer, randomly set the time interval and control the number of snowflakes;

Sj.addeventlistener (Timerevent.timer, SJCD);

Using SJ to listen for time events;

function SJCD (event:timerevent) {

Declare a SJCD function

var xh:xh_mc=new xh_mc ();

First declare an object XH, type XH_MC, equal to a new type XH_MC;

AddChild (XH);

Display the newly declared XH object on the stage;

Xh.x=math.random () *550;

The snowflake x coordinates appear randomly on the 550 stage;

Xh.y=math.random () *200;

The Snowflake y coordinate control is randomly appearing at 0-200 places on the stage;

Xh.alpha=math.random () *1+0.2;

The random transparency of snowflakes;

Xh.scalex=math.random () *0.5+0.5;

Randomly controlling the width of snowflakes in x;

Xh.scaley=math.random () *0.5+0.5;

Randomly control the width of the snowflake in Y;

}

Sj.start ();//time begins;

Snow code:

The code is as follows:

var sj:timer =new Timer (Math.random () *300+100,100);

Sj.addeventlistener (Timerevent.timer, SJCD);

function SJCD (event:timerevent) {

var xh:xh_mc=new xh_mc ();

AddChild (XH);

Xh.x=math.random () *550;

Xh.y=math.random () *200;

Xh.alpha=math.random () *1+0.2;

Xh.scalex=math.random () *0.5+0.5;

Xh.scaley=math.random () *0.5+0.5;

}

Sj.start ();

Four, close the Action window test save.

The above is the Flash Ationscrip 3.0 make lifelike snow GIF animation effect method, hope to be helpful to everybody!

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.