CODE
EXPLANATION
this.createEmptyMovieClip("holder",
this.getNextHighestDepth());
This
code creates and empty movieclip on stage
holder.maxdrops=600;//no
of drops
var downspeed=500;//speed of the drops
var dropslop=30;//slop of the drops
This part starts variables to be used in the script here maxdrops
gives the maximum no of clips to be attached and dropspeed represents
the speed of the drops
//Part
1 attaching the clips with loop
for(i=0;i<holder.maxdrops;i++){
holder.attachMovie("circleclip","drop"+i,i+5);
focuseddrop=holder["drop"+i]
focuseddrop.cacheAsBitmap=true;
focuseddrop._x=random(Stage.width);
focuseddrop._y=random(Stage.height);
focuseddrop._yscale=random(100);
focuseddrop._rotation=-dropslop;
}
this
is the loop to attach movieclip "circleclip" that we
have exported for actionscript.Now clips named drop1 drop2 drop3
etc will be attached to the empty movieclip "holder"
according to the value of i.
In
each loop the variable name "focuseddrop" is given to
the i th movieclip and its properties like _xscale xposition etc
are set.Now for alpha I have linked it with the scaling of clips
so that big drops that are nearer will have high alpha and others
away will have low alpha.Thus part 1 of the code is completed
now we have to make movement to the clip.For that we should make
an interval to repeat a function in a certain time, so that the
y position and x position of each clip can be changed to create
movement