Lebanon web design, development, hosting , seo, email marketing and E-commerce solutions
Fireworks PDF Print E-mail
User Rating: / 0
PoorBest 


First Step

¡ö Start with a new movie.

¡ö Choose Insert New Symbol, give it the movie clip behavior, name it myBeam, and click OK.

¡ö Change the zoom factor to 800. Create a small black circle (about 7 pixels across) with no stroke (just fill) on the registration point.Use the Horizontal scrollbar to scroll the registration point to the left side of your screen.

¡ö Select the circle and choose Insert----> Convert to Symbol.Name it Dot.

¡ö Insert a keyframe (F6) in Frame 4. Click Frame 4 and move Dot about 6 pixels to the right. Select Frames 1 through 4 and choose Motion from the Tween drop-down list of the Property inspector

¡ö Insert a keyframe in Frame 5. Delete Dot. In its place, draw a rectangle with a fill only, about 16 pixels wide and 2 pixels high. Choose Insert --> Convert to Symbol and name it Ray.

¡ö Insert a keyframe in Frame 12. Click Frame 12 and move Ray almost to the right side of the screen (at 800% zoom).Use the Free Transform tool to make the rectangle narrower, about 9 pixels. Select Frames 5 through 12 and click Motion from the Tween drop-down list of the Property inspector.

¡ö Insert keyframes in Frames 13 and 14 and in each frame move Ray slightly to the right and make it a little narrower from side to side.You should now be at about the middle of your screen.

¡ö Insert a keyframe at Frame 15. Delete the rectangle and in its place draw a sparkle. I did this by drawing two rectangles, choosing Modify --> Transform--> Scale and Rotate, and rotating one by 45 degrees and the other by ¨C45 degrees. Then I placed one on top of the other. Choose Insert --> Convert to Symbol and call it Sparkle.

¡ö Insert a keyframe at Frame 50. Click Frame 50 and move Sparkle horizontally to the right side of your screen. Select the frames and make it a motion tween.

¡ö Click Scene 1 to return to the main Timeline.

 
Step 2:actionscript

¡ö Choose Insert--> New Symbol.Make it a movie clip named firework.

¡ö From the Library (Window--> Library) drag in an instance of myBeam. In the Property inspector, type myBeam1 in the Instance Name text box.

¡ö Insert a layer named actions. Add keyframes in Frames 2 and 3. In the first keyframe, type or paste in the following ActionScript.

Code

//This action script duplicates the
//symbol instance myBeam1
//and rotates it to appear as the
//firework. It randomizes the//overall size of the firework, as
//well as the individual beam
//lengths. It also randomizes the
//color of each firework.
//Initialize variables
i=0;
//Cf is the variable that counts the
//frame and aids in setting
//the alpha value so that the
//fireworks twinkle.
cf=0;
//Number of beams regulates the
//fullness of each firework.
numberOfBeams=40;
// Random sizes are set for a single
//firework on the screen
myScale = 20 + Random(80);
//Make the instance, myBeam1,
//visible. This is necessary because
//myBeam1 gets set to invisible
//below.
setProperty("myBeam1",_visible,true)
;
// A maximum random size is set for
//the next firework on the screen
xyscalevar = 20 + Random(80);
//Randomize the color of the next
//firework
colorArray=["FF","00","33","99","66",
"CC"]
myColor=new Color(myBeam1);
myColor.setRGB("0x"+colorArray
[Random(6)]+colorArray[Random(6)]+
colorArray[Random(6)]);
// The following lines create the
//firework from a single beam
// and give each beam a random length
//which does not exceed the maximum
//size
// set by the variable xyscalevar
//above
do {
duplicateMovieClip("myBeam1","beam"
add i,i);
setProperty("beam" + i,_rotation,
random(360));
setProperty("beam" +
i,_xscale,myScale+random(myScale));
setProperty("beam" +
i,_yscale,myScale+random(myScale));
i = Number(i) + 1;
)
while (Number(i)<=numberOfBeams
)
//Make the instance, myBeam1,
//invisible. This is necessary
//because myBeam1 was never resized
//for this particular
//firework and it would look odd if
//it were visible.
setProperty("myBeam1",_visible,false
);
//This action script assigns the
//alpha value so that the
//fireworks twinkle. It counts the
//frames and assigns
//new alpha values depending on which
//frame the movie is in.
//Some beams do not twinkle at all.
//Increment the frame counter.
cf=cf+2;
//When the frame counter = 80, start
//a new firework.
if(cf>=80) {gotoAndPlay(1);}
//Set the new alphas for the twinkle.
//Don¡¯t twinkle until after
//the tenth frame.
if(cf>=10) {
setProperty("beam" +
((cf/2)+1),_alpha,75);
setProperty("beam" +
((cf/2)+2),_alpha,50);
setProperty("beam" +
((cf/2)+3),_alpha,25);
setProperty("beam" +
((cf/2)+4),_alpha,0);
setProperty("beam" +
((cf/2)+5),_alpha,25);
setProperty("beam" +
((cf/2)+6),_alpha,50);
setProperty("beam" +
((cf/2)+7),_alpha,75);
setProperty("beam" +
((cf/2)+8),_alpha,100);
setProperty("beam" +
((cf/2)+9),_alpha,75);
setProperty("beam" +
((cf/2)+10),_alpha,50);
setProperty("beam" +
((cf/2)+11),_alpha,25);
setProperty("beam" +
((cf/2)+12),_alpha,0);
setProperty("beam" +
((cf/2)+13),_alpha,25);
setProperty("beam" +
((cf/2)+14),_alpha,50);
setProperty("beam" +
((cf/2)+15),_alpha,75);
setProperty("beam" +
((cf/2)+16),_alpha,100);
setProperty("beam" + ((cf/2)-
1),_alpha,75);
setProperty("beam" + ((cf/2)-
2),_alpha,50);
setProperty("beam" + ((cf/2)-
3),_alpha,25);
setProperty("beam" + ((cf/2)-
4),_alpha,0);
setProperty("beam" + ((cf/2)-
5),_alpha,25);
setProperty("beam" + ((cf/2)-
6),_alpha,50);
setProperty("beam" + ((cf/2)-
7),_alpha,75);
setProperty("beam" + ((cf/2)-
8),_alpha,100);
setProperty("beam" + ((cf/2)-
9),_alpha,75);
setProperty("beam" + ((cf/2)-
10),_alpha,50);
setProperty("beam" + ((cf/2)-
11),_alpha,25);
setProperty("beam" + ((cf/2)-
12),_alpha,0);
setProperty("beam" + ((cf/2)-
13),_alpha,25);
setProperty("beam" + ((cf/2)-
14),_alpha,50);
setProperty("beam" + ((cf/2)-
15),_alpha,75);
setProperty("beam" + ((cf/2)-
16),_alpha,100);
}
//Gradually fade the firework out in
//the last twenty frames.
//Initialize ii.
ii=0;
if (cf>=61) {
myAlpha=100-((cf-61)*4);
do {
if(getProperty("beam"+ii,_alpha)>=
myAlpha) {
setProperty("beam" +
ii,_alpha,myAlpha);
}
ii = Number(ii) + 1;
}
while (Number(ii)<=numberOfBeams
)
}

  ¡ö In Frame 3, type or paste in the following ActionScript.

gotoAndPlay(2);
¡ö Add a frame (F5) in Frame 3 of Layer 1.

¡ö Click Scene 1 to return to the main Timeline.

Last Step

¡ö Insert a new layer and call it actions. Rename Layer 1 to fireworks.

¡ö On the fireworks layer, click Frame 1. Drag in an instance of firework.

¡ö Insert keyframes in Frames 8, 14, 24, and 36 (the exact frame numbers are not important). Click each keyframe and drag in an instance of firework to a different location on the Stage.

¡ö Insert a frame two frames after the last keyframe (which would be Frame 38 in our example).

¡ö On the actions layer, insert a keyframe in Frame 38 (the same last frame number of the fireworks layer). Type or paste in the following ActionScript:

gotoAndPlay(37);
¡ö Choose Edit Document. Change the background to black and change the frame rate to 24 frames per second.
 
Next >

Subscribe

Be alerted with news and updates at Lebvision.com