Flash MV Random background making

Source: Internet
Author: User
Random in the production of Flash MV, background is the production of a very important part of the animation, but also some people call the background vision. Many friends in the background, like pure hand-drawn, of course, this is an effective way. In this case, however, we will use the ActionScript script extensively to produce a random effect of the vision (see Flash key terminology interpretation after the article).

Use action to create the background effect, is random, not as hand-drawn, as a "dead object", I believe only in the production, will also reduce a lot of "coolie." The end of the article provides the FLA original file download.

1. Create a new layer in the scene, the layer name is "background", place the background layer below the character layer (three layers from top to bottom in order of "curtain", "character", "background"), draw a dark blue background in the scene, and then press F8 to convert it to graphic first, Then convert it to movie Clip, so that it has a nested structure. Then draw some white color blocks with a lower transparency to the background, as shown in Figure 1.


2. Create a new layer in the movie clip, draw a flower at the top of the scene, convert the flower to a movie clip, make it float in the movie clip, and then convert the flower into a nested structure for the two-layer movie clip (see Flash Key terminology Interpretation) (Figure 2).


3. Enter the movie clip, select the flower instance, in the properties panel instance name input box, enter the movie clip's instance name as flower, create a new layer, add the code at frame 1th as follows:

i=0; Variable i equals 0
max=10; Variable Max equals 10
Flower._visible=false; Movie Clip's properties are not displayed


In frame 5th, press F6 and add the following code:

if (I<max) {
Flower.duplicatemovieclip ("Flower" +i,i);
this["Flower" +i]._x=275-random (550);
this["Flower" +i]._y=random (50) +50;
this["Flower" +i]._alpha=random (50) +50;
this["Flower" +i]._width=random (30) +10;
this["Flower" +i]._height=this["flower" +i]._width;
i++;
}


Code Comment: When the variable i is less than Max,
Start copying the flower instance, the replica's depth is variable i,
The x coordinate of the replica is 275 minus 550 of the random number,
The y-coordinate of a replica is 50 plus a random number of 50,
The transparency of a replica is 50 plus a random number of 50,
The width of the replica is 10 plus a random number of 30,
The height of the replica is its width,
The variable i increments.

4. In frame 6th, press F6 key, build key frame, enter code Gotoandplay2, let movie clip loop play 2nd frame. The effect of floating flowers is shown in Figure 3.


5. Double-click the blank area back to the background movie clip, at frame 100th and frame 115th, press F6 Key, establish the key frame, set the background of the transparency changes from 100 to 0, that is, slowly gradually out of the scene. Then create a new layer, place the layer below the layer of the flower, and then use a similar method to produce the effect of rain.

6. In this background of the film clips, the original form of the rain effect made into a film clip, the instance name is "Dian", add three keyframes for the rain animation, the 1th frame code is as follows:

dian._visible=0;
i=0;
max=50;


The 2nd frame code is as follows:

if (I<=max) {
Dian.duplicatemovieclip ("Dian" +i,i);
this["Dian" +i]._x=275-random (550);
this["Dian" +i]._y=dian._y+random (50);
this["Dian" +i]._alpha=random (30);
i++;
}

The 3rd Frame code is gotoandplay (2) , and the final effect is shown in Figure 4.


7. Create a new layer, in the No. 300 frame, produce such as dusk falling leaves effect, frame 1th and 10th, similar to the previous example, its 2nd frame code is as follows:

if (I<max) {
Yie.duplicatemovieclip ("Yie" +i,i);
this["Yie" +i]._x=yie._x+ (100-random (200));
this["Yie" +i]._y=yie._y+ (100-random (200));
this["Yie" +i]._width=20+random (30);
this["Yie" +i]._height=20+random (30);
i++;
}

8. In the No. 410 frame, the background of the production of Stars and the moon, drawing characters, placed in the top of the moon, adjust the head of the transparency of 20, the effect as shown in Figure 5.


The background of the production of the basic finished, if you have to see where you can download the FLA original file carefully studied.

  Flash Key Terminology Interpretation

As ActionScript (Action script)

This is an embedded script language for developing interactive interfaces and animations in Flash, using as as a quick and easy way to develop dazzling animation effects and exciting interactive games. Especially since Flash5.0, as has been more perfect, forming a part of Flash.

Nested structure for double-layer movie clips

The nested structure of a two-tier movie clip is to convert it into a movie clip and nest it again in a movie clip, which is good for action control.



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.