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.
Now we need to create the main movieclip. Press 'Ctrl+F8' and type the name
as flyin. Leave the behaviour as the default - Movieclip itself. Click OK.
Now drag the spark movieclip from the Library panel to some place near the
plus sign in the stage. This need not be accurate. You can place the clip
anywhere on the stage.
Press 'Ctrl+I' to invoke the Instances Panel. In the Name field, give the
name of the instance as 'MouseFollower'.
Click on Frame 20. Press F5 to insert frames upto 20. Now click Insert menu
- Layer. Click on the First frame of the newly created layer. Press F6 19
times to convert all the frames in layer 2 into keyframes.
Click on Frame 1 of Layer 2. Invoke the Frame Actions panel and convert
it to Expert mode as explained earlier. Enter the following code in the panel:
Explanation:
Here you will find the explanation for the above code. You can skip this
if you don't want to understand anything.
The first line makes the mousefollower movieclip invisible, temporarily.
The second line tells the player that the mousefollower movieclip moves
along with the mouse.
The lines 3,4,5 and 6 initialize variables that will be used below.
All the above code will be executed only once. The following code will be
nested inside a function and executed in every frame again and again.
Inside the function, it is first checked if the iFireCount variable is less
than 75. This variable keeps track of the number of instances of the mousefollower
movieclip that are present in the stage at any given point. It also gives
a way of uniquely reffering to any instance at any time.
The iFireCount variable also is incremented each time this function is executed.
We then duplicate the MouseFollower movieclip. We name it as MouseFollower
followed by an index number, the iFireCount variable. The last parameter
of the duplicateMovieClip function specifies the layer of the duplicated
movieclip - it determines which instance stays above which instance.
Since the main parent MouseFollower movieclip is always under the mouse,
the new instance stays at the position of the mouse. But if the mouse is
moved after the creation, it will not move, because we did not give the
startdrag property for the created instance.
Now the mousefollower movieclip is made visible.
All the above clip will only duplicate the movieclip. It will not rotate
the duplicates to produce the effect we need. So, we need another variable
which will be incremented each time and will be set as the value for rotation
of each instance. To add some randomness, we give a random incrementation.
So, at one time, two instances can be closely spaced, while at other times,
they may be farther from each other.
We also ensure that the value of degCount does not go above 360 degrees.
At last, we tell each instance of the MouseFollower MovieClip that the variable
'Me' refers to itself, so that it can easily remove itself as soon as it
finishes playing. It's sort of killing yourself as soon as your job is over.
And then we say that the cursor is hidden, to produce a cool effect.
Now enter the following code in all the other frames following frame 1 in
layer 2, after converting the 'Frame Actions' panel to Expert mode:
MouseTrails();
In the last frame alone, include this extra line:
gotoAndPlay(2);
Tip:
Here is a tip. When you are creating a movie of your own, which has just
2 frames, so that there is a loop, you can optimize it so that it plays
faster. To do so, just insert the code that you want to repeat again and
again in a function and call this function in every frame and after 10 frames,
use a gotoAndPlay method to go back to the second frame. This is done because,
gotoAndPlay methods or loops take a longer time to play, and reduce the
frame rate drastically. You can try it out here itself. Include the statement
gotoAndPlay(2); in the 3rd frame's script itself. You can see that it will
slow down the movie.
Click Modify menu - Scene. This opens the Scene Panel. Click Scene 1 to
go to the main Scene. Drag the flyin movieclip from the Library to the middle
of the Scene. Now click in frame 1 and enter the following code in the actions
panel after converting it to expert mode.
And voila! youre finished! Save the .fla file and publish it to see the fruits
of your hard work.
Thanks very much for having the patience to go through this tutorial. I hope
that this tutorial will be a valuable addition to your knowledge base in flash.
No one is perfect and I know I am no good at that. I found that I had commited
a lot of mistakes in my Tutorial. All you Flash fathers out there, I will be
the happiest person if you were able to spot them and send them to by mail to
ramraj_1999@yahoo.com. Suggestions and new ideas are also welcome.
And if you have not yet checked it out, visit my 3D Flower tutorial in the 3d
section of tutorials in Flashkit.com. It is even more difficult and challenging.
Note:
Many of you mailed me requesting me to send you the .fla file for the tutorial
when I posted 3d Flower. But incase you haven't noticed it, you can download
the .fla file from Flashkit itself - you will find the link in the left column
in this page.
You can also do wonders just by changing a small part of the script. Here are just two examples. Select one from the drop down list: