Congratulations on the New Year! Make colorful fireworks animation

Source: Internet
Author: User
Tags copy empty insert interface
See a lot of introduction to the production of fireworks posts, do not meet the effect of the new year, their own flash MX try to do a fireworks, you have to look at the effect is OK, continue to look at, and help top, there are errors in welcome correct. Look at the effect is not good, quickly shut down.

Final Effect preview:





   Click to download source file (rar compressed file, 59K)

The goal is: where the mouse clicks, where the fireworks bloom. Consecutive clicks, while blooming different colors of fireworks

The practice is briefly described as follows, the name in the text uses the name of the source file, some of the general operation of the introduction of the omitted.

First, the preparatory work:

Fireworks Basic components: The name of this paragraph, only for the convenience of identification, can be arbitrarily named. The practice of the basic components of fireworks is only a reference, fully free to play, because the release of the source documents, the introduction only said the general practice.

1, create a new graphic element, draw a red graphic, you can draw 1 first circle, and then use the arrow tool to lengthen back. As shown in Figure 1. Named as the basic component (Figure 1)




Figure 1

2, and then create a new graphic components, drawing a gray figure, such as Fig. 2, named smoke. Select "Smoke" graphics, open the color mixer, select "Linear", adjust the "smoke" Front end transparency (Alpha) in 50% or so, back-end transparency in about 10%. (Figure 2)




Figure 2
3, a new film clip components (MC), named as fireworks components, built 2 layers, above the fireworks, the following is smoke. Drag the top 2 graphic elements into 2 layers, place the left level of the component +, as shown in Figure 3, and insert the keyframe at frame 10th. And then proceed with the processing. To make it easier to see, the color of the smoke in Figure 3 has changed.

(1) Select the fireworks pattern of the 10th frame of the fireworks layer, use the keyboard arrow keys to move it forward to ruler 100, and then use the Freeform tool or modify the "wide" data in the attribute to change the original long shape into a dot shape and create "action" changes between 1-10 frames. To add results, copy frame 10th, copy to 11th, 13 frames, and change the color of the dots to white.

(2) Selection of smoke layer 1th frame smoke graphics, using the above method to shorten it, select smoke layer 10th frame smoke graphics, with the keyboard arrow keys to move it forward, the front and immediately follow the fireworks graphics dot, in 1-10 frames between the "action" change. To add results, insert keyframes at 13 frames, adjust transparency (Alpha) to around 30%, and create "action" changes between 10-13 frames. (Figure 3)




Figure 3
4, a new key element, the first 3 frame blank, do not need processing, in the 4th Frame reaction Zone (click), with any color draw a rectangle, the size of the same size as the flash works. is an empty key.

5, according to their hobbies, prepare background pictures, text.

   Part Two, as

1, a new MC, named "Fireworks", which layer 2 is the sound effect of fireworks, not introduced.
Layer 1 1th, 2 frames are frame-by-animation, with the red color line performance of fireworks rose time traces, red lines are vertical, position alignment element interface +, Figure 4 is the 2nd frame of the screen.




Figure 4
Drag the pyrotechnic components made in preparation for 3 into layer 1, frame 3, pyrotechnic components + alignment of the operating interface of the "fireworks" Components +, selected on the stage dragged on the pyrotechnic components, in the attribute to the MC named Fire (this name can not be wrong, must be consistent with the following as in), Then insert the normal frame at 15 frames (same as the number of frames that are dragged into the pyrotechnic element).

Select the Layer 1 3 frame, write the following frame action, you can select the Expert mode, copy, paste up, as the role is to the fireworks components by the circumference distribution, randomly copied under 100, get a more beautiful fireworks:

for (i=1;i<100;i++) {
Duplicatemovieclip ("Fire", "Fire" add i,i);
SetProperty ("Fire" add I,_rotation,random ());
SetProperty ("Fire" add i,_xscale,random (100));
SetProperty ("Fire" add i,_yscale,random (100));
}

Insert a blank keyframe at frame 16th, select this frame, and write the following frame action, which is to remove the entire myMC1 and stop the copied fireworks component.

Stop ();
Removemovieclip (myMC1);

2, the production scene part

Scenes like Figure 5, on 3 layers, 4 frames. (Figure 5)




Figure 5
(1) Background layer into the prepared background picture, text.
(2) in the "key" layer 1th frame to write the following frame action:

var i=0;


Insert the keyframe at frame 2nd of the key layer, and write the following frame action to stop playing to frame 2nd.

Stop ();

In the "key" layer frame 2nd Drag the Made blank button, the empty key is dragged into the stage to render green, adjust to just cover the stage, and then insert the normal frame at frame 4th.

Select the key, write the following key action, the role is when the mouse clicks the button, get the mouse click position x, y coordinates, for the reproduction of the fireworks components of the new name MyMC1, and play to the 3rd frame.

On (release) {
x = _xmouse;
y = _ymouse;
var myMC1 = "MYMC" Add I;
gotoAndPlay (3);
}

(3) Insert the key frame at frame 3rd, drag into the "fireworks" MC above and insert the key frame in frame 4th.
In the "Layer" frame 3rd Select the dragged "Fireworks" MC (inconvenient can first lock the key layer and then select the MC), in the attribute named MYMC, this name must be the same as in the name, can not be wrong.

Select the "Layer" frame 3rd, write the following frame action, the role is to copy the "Fireworks" MC, and its coordinate position with the mouse click at the same place. Reach the target where the mouse clicks, where the fireworks bloom.

i = i+1;
_root.mymc.duplicatemovieclip (myMC1, 100+i);
SetProperty (myMC1, _x, x);
SetProperty (myMC1, _y, y);

Select "Layer" frame 4th to write the following frame action, which is to return to frame 2nd and stop to start again.

gotoAndStop (2);

(4) in the "Layer" 3rd frame selected drag into the "Fireworks" MC (inconvenient can first lock the key layer and then select the MC), write the following film clip action, the role is to press the mouse when the "fireworks" MC color random change. Reach the goal of continuous click, while blooming different colors of fireworks.

Onclipevent (MouseDown) {
This.c=new Color (this);
This.c.setrgb (Random (0xFFFFFF));
}

When making, the above mentioned frame action, key action, film editing action do not make a mistake, you can first look at the action panel name, and then open write as.

The problem is the use of replication two times in pyrotechnic components and casts, sometimes slightly slower. Also hope master advice, to be improved.


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.