Get Latest Nokia Press Release Click Here

Search in Site

RainDrops Effect In Flash

Learn to Make Beautiful Rain Drops Effect In flash Lite

To Download My Projects. Click The Links Below:


Tutorial:
For This Create A new Project flash 8,As2
Insert A New Symbol 
Enter the Name "Circleclip" In Name Field And Select Movie Clip As Type From Option 
Now Double Click On It .
Create A Ellipse Shaped Rain From Tools 
Come Back To Scene 1 (Main Area Of our Project).
Now Press F9 And Paste The Following Codes.


//Creating an empty movieclip to attach the clip from library
_root.createEmptyMovieClip("holder",this.getNextHighestDepth());
//settig variables
holder.maxdrops=30;//no of drops
var downspeed=15;//speed of the drops
var dropslop=10;//slop 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;
}

//part 2 setting an interval for motion of drops
var dropup=setInterval(movedrop,1)
//function to repeat in the interval
function movedrop(){
for(i=0;i<holder.maxdrops;i++){
focuseddrop=holder["drop"+i]
focuseddrop._rotation=-dropslop;
focuseddrop._y+=25+downspeed/focuseddrop._yscale;
focuseddrop.x+=Math.tan(dropslop);
if(focuseddrop._y>=Stage.height+20){
focuseddrop._y=random(30);
focuseddrop._x=random(Stage.width);
}
}
}
After it Save Your File And Run The Swf File.

0 comments:

Post a Comment