# Need help with a snow effect

**URL:** https://forum.kirupa.com/t/need-help-with-a-snow-effect/164425
**Category:** Uncategorized
**Created:** [October 1, 2005, 1:46am UTC](https://forum.kirupa.com/t/need-help-with-a-snow-effect/164425 "2005-10-01T01:46:23Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![BaconIsGood4You](https://avatars.discourse-cdn.com/v4/letter/b/50afbb/32.png) [@BaconIsGood4You](https://forum.kirupa.com/u/BaconIsGood4You)
#### Post date: [October 1, 2005, 1:46am UTC](https://forum.kirupa.com/t/need-help-with-a-snow-effect/164425/1 "2005-10-01T01:46:23Z")

</div>

Ok, I need alot of help with this as I have no idea.

I am panning through a forest with snow falling (so falling snow is panning with background). Then I want the snow to stop (not just disappear, but ones already falling to continue down but no more appear) after panning has ended (snow stops panning also).

The Snow 2.0 tutorial isn’t quite what I need. The closest I have found is this code. I also want the size of the snow to vary (like in Snow 2.0

> var swidth = 550;  
> var sheight = 400;

\_root.createEmptyMovieClip(“DropClip”, 15999);

for(var i=0; i\<200; i++)  
{  
createdrop(random(sheight));  
}

var storm = setInterval(createdrop, 1);

function createdrop(y)  
{  
var clip = “drop” + Math.random();  
\_root.DropClip.attachMovie(“Drop”, clip, random(15999));  
\_root.DropClip[clip].\_x = -100 + random(700);  
if(y != null)  
{  
\_root.DropClip[clip].\_y = y;  
}

```
_root.DropClip[clip]._alpha = random(80)+20;
_root.DropClip[clip].speed = random(10)+10;
_root.DropClip[clip].direction = (random(2) == 1) ? 1 : -1;
_root.DropClip[clip].onEnterFrame = fall;

```

}

function fall()  
{  
if(this.\_y \< sheight && ((this.\_x \> 0 && this.direction == -1) || (this.\_x \< swidth && this.direction == 1)))  
{  
this.\_y += 1 + this.speed;  
this.\_x += this.direction + this.direction(random(1));  
}  
else  
{  
delete this.onEnterFrame;  
this.removeMovieClip();  
}  
}

Thankyou for any help you can give.
