# Rain Effect

**URL:** <https://forum.kirupa.com/t/rain-effect/18852>\
**Category:** flash\
**Created:** [April 22, 2003, 12:20am UTC](https://forum.kirupa.com/t/rain-effect/18852 "2003-04-22T00:20:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![OpTimus](https://avatars.discourse-cdn.com/v4/letter/o/59ef9b/32.png) [@OpTimus](https://forum.kirupa.com/u/OpTimus)\
**Post date:** [April 22, 2003, 12:20am UTC](https://forum.kirupa.com/t/rain-effect/18852/1 "2003-04-22T00:20:15Z")

</div>

Can someone show me a tutorial that would help me out on creating a rain effect thx

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 22, 2003, 12:25am UTC](https://forum.kirupa.com/t/rain-effect/18852/2 "2003-04-22T00:25:27Z")

</div>

Hey there:  
I like doing stuff like that:beam:

As far as I know, there isn’t really a tutorial on it. I made the fla called thunderstars to simulate a warp effect. You can change the code around and the apperance of the star/raindrop. It doesn’t use any tweens.  
The other one (realLightning) I got off the internet I think at [FlashKit.com](http://FlashKit.com).  
Good luck!!

[http://freddythunder.com/flas/thunderstars.fla](http://freddythunder.com/flas/thunderstars.fla)  
[http://freddythunder.com/flas/realLightning.fla](http://freddythunder.com/flas/realLightning.fla)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 22, 2003, 12:27am UTC](https://forum.kirupa.com/t/rain-effect/18852/3 "2003-04-22T00:27:58Z")

</div>

what was that…🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 22, 2003, 12:36am UTC](https://forum.kirupa.com/t/rain-effect/18852/4 "2003-04-22T00:36:57Z")

</div>

sorry, my finger slipped on the enter key early  
…premature enteration  
:x

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 22, 2003, 1:57am UTC](https://forum.kirupa.com/t/rain-effect/18852/5 "2003-04-22T01:57:38Z")

</div>

2 steps

1. Make a movie clip named rain (it should represent a rain drop)

2. make some AS which duplicates the movie clip a certain amount of times, give it a random \_x and a \_y that is above the screen. then apply some direction to the clips. the code should look similar to the one below:

[AS]rain.\_visible = false;  
amountOfRain = 100  
moveMe = function () {  
this.\_x += this.dx;  
this.\_y -= this.dy;  
this.\_alpha -= 2;  
if (this.\_y\>400) {  
this.dx = Math.random()_3;  
this.dy = Math.random()_-8-4;  
this.\_alpha = 100;  
this.\_x = Math.random()\*550;  
this.\_y = 0;  
}  
if (this.\_x\>550) {  
this.dx = Math.random()_3;  
this.dy = Math.random()_-8-4;  
this.\_alpha = 100;  
this.\_x = Math.random()\*550;  
this.\_y = 0;  
}  
};  
for (i=0; i\<amountOfRain; i++) {  
nm = “rain” add i;  
rain.duplicateMovieClip(nm, i);  
scale = Math.random()\*80+50;  
\_root[nm].\_xscale = scale;  
\_root[nm].\_yscale = scale;  
\_root[nm].dx = Math.random()_3;  
\_root[nm].dy = Math.random()_-8-4;  
\_root[nm].onEnterFrame = moveMe;  
\_root[nm].\_x = Math.random()_550;  
\_root[nm].\_y = Math.random()_-400;  
}[/AS]

have phun 🙂

p.s.  
dx represents wind, dy is the downward speed, amountOfRain is how many times the rain MC should be duplicated (i recomend under 200) the “this.\_alpha -= 2” controls the speed at which the rain fades. anymore questions, ask me 😉

-mike

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 22, 2003, 3:41am UTC](https://forum.kirupa.com/t/rain-effect/18852/6 "2003-04-22T03:41:37Z")

</div>

thx alot zylum…🙂 much thanks… !!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 22, 2003, 3:46am UTC](https://forum.kirupa.com/t/rain-effect/18852/7 "2003-04-22T03:46:29Z")

</div>

now if I had a lightning affect to go with it that would be sweet…any ideas? darn thats sweet,… !!
