Featured FLA
» Author: Bugra Ozden
» Title: Skatalog v9 - product catalog
» Description: Create your product catalog easly and publish on your website or Create your image gallery, documents list, portfolio. Fully XML Driven
» More by Bugra Ozden
Featured Site
» Posted in the Flash Kit Links section
» Title: Creative DW Image Show PRO
» Description: Creative DW Image Show PRO is a Dreamweaver extension which enables the user to create multimedia presentations. It combines the features of the popular Creative DW Image Show with the ability to add professional text effects to slides (similar to After Effects). The product is very customizable: the user can choose the duration of the transition effects, the slide motion start and end position, zoom and panning type for both images and texts.
¡ö 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
);