| home | about | time | appearance | space | other | tips & tricks |
Light Worms (I)This effect is based on duplicating a single dot that moves in a random direction. The advantages of the technique presented in this page in the small size of the resulting file and easy implementation. ![]() First thing we need is a dot and a transparent circle around it, just like in the picture. Place the dot and the circle on different layers inside a Movie Clip. Using Tween Shape, on both layers, make the shapes disappear. Decide on the length of the effect and create the final frame by inserting a new keyframe in the desired position. Then change the "_alpha" parameter of the color (in the Color Mixer) to zero. So you have created the fade out of the two elements: the dot and the circle. We made the circle fade faster so we moved the final frame a bit to the right. Remember the number of frames that you have in this Movie Clip's Timeline because this is very important (in our case is 158 at 20 fps rate).
![]() The Movie Clip with the dot and circle must be moved along a path. But first we have to include this Clip into another one to create the motion. In this new Symbol we did a sinusoidal path by using the brush tool in an upper layer and changed it into a guide. Now make sure the dot is on the layer that's guided. Create the motion by placing one instance of the Clip on the top of the line and one in the frame 158 at the bottom of the line. What you got now is a dot that moves from the center to the side while fading. Because the length of the two Clips we did is 158, we won't have any problems with controlling them because these always synchronize. Here is where the random part intervenes. All the clip have the ability to rotate and that can be done by manipulating the "_rotation" parameter with values that range from -180 to 180, depending of the direction and number of degrees that we want to move the symbol (from the original spot). Random rotation value can be generated in the following way: scale = 180 - random(360); scale = [-179 ... 0 ... 180]; If you are asking why we neglected the value "-180 ", well the answer is -180=180 when we speak about rotation. This Movie Clip has to look different each time we get to frame one so we add the next Action Script on it: scale = 180 - random( 360 ); setProperty(_target, _rotation, scale); So now the dot moves to a different direction each time it starts its motion. Now let's get back to the Main Stage where we have one Clip with the shiny dot that moves from the center to a random side. The magic trick must be Flash's ability to duplicate the Movie Clips and in our case that is the last thing to do because our symbols think their direction randomly without interventions from outside. We did this with the aid of another MC placed in the Main Stage (the one located at the bottom left corner-"engine"). We assigned him with the next Action Scrip Sequence:
onClipEvent( load ) {
i = 1;
max = 158;
}
onClipEvent( enterFrame ) {
if( i <= max ) {
_parent.point.duplicateMovieClip("point"+i, i);
i++;
}
}
The MC with the dot was originally named "point" so we duplicated it by 158 times creating one each time the Movie enters a new Frame. The number 158 appears again and here it assures the continuously appearance of new moving dots that kind of resemble to some light worms. In each frame one light worm appears and one disappears except for frame one and 159 and so one (when we have two, the original and one duplicated). Next you will see how to randomize even more the "Light worms" effect. |
| Copyright © 2010 WebArticles.org. All rights reserved. Privacy Policy. |
| FlashRandomEffects.WebArticles.Org is not affiliated with Adobe Systems Incorporated, USA. Adobe Flash is a registered trademark of Adobe Systems, Inc in the United States of America and/or other countries. The purpose of this website is to provide information for mastering Adobe Flash and creating Flash effects. |