First time here? First time here? Newsletter Signup Newsletter
Search tutorials
Author: EmperorGR

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.


//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
//Cf is the variable that counts the
//frame and aids in setting
//the alpha value so that the
//fireworks twinkle.
//Number of beams regulates the
//fullness of each firework.
// 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
// A maximum random size is set for
//the next firework on the screen
xyscalevar = 20 + Random(80);
//Randomize the color of the next
myColor=new Color(myBeam1);
// The following lines create the
//firework from a single beam
// and give each beam a random length
//which does not exceed the maximum
// set by the variable xyscalevar
do {
add i,i);
setProperty("beam" + i,_rotation,
setProperty("beam" +
setProperty("beam" +
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.
» Level Basic

Added: 2003-12-26
Rating: 5.84 Votes: 63
(10 being the highest)
» Author
18 years old,student,new to Flash
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!
Featured Flash FLA
» Author: Inocreato
» Title: RaiseTheBlocks
» Description: Raise all the blocks to win the game
Featured Sound Loops
Image for equalize

Audio Player

» Author: TomCat Carty
» Title: The Wood
» Description: Just a little game ending or it can maybe be looped. Recorders with music box and percussion to give the feel of well, I don't know, the woods? Free to use, just credit me. thank you
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: Davisigner
» Description: Hmm... what to say about this one? It's reminiscent of the closing notes of the opening music from the Three Stooges done in a church organ style with a closing cymbal crash. I'll give this one away gratis, but feel free to check out my free loops and potential upcoming license-mandated ones over in the respective part of Flashkit.