# Kirupa's Snow Effect

**URL:** <https://forum.kirupa.com/t/kirupas-snow-effect/23616>\
**Category:** flash\
**Created:** [June 20, 2003, 5:19am UTC](https://forum.kirupa.com/t/kirupas-snow-effect/23616 "2003-06-20T05:19:55Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![NeoDreamer](https://avatars.discourse-cdn.com/v4/letter/n/ccd318/32.png) [@NeoDreamer](https://forum.kirupa.com/u/NeoDreamer)\
**Post date:** [June 20, 2003, 5:19am UTC](https://forum.kirupa.com/t/kirupas-snow-effect/23616/1 "2003-06-20T05:19:55Z")

</div>

How can I alter Kirupa’s snow effect ( [http://www.kirupa.com/developer/mx/snow.htm](http://www.kirupa.com/developer/mx/snow.htm) ) so that it begins on a slow start? Just have little snow start it off and then gradually reach the original effect.

---

<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:** [June 20, 2003, 6:28am UTC](https://forum.kirupa.com/t/kirupas-snow-effect/23616/2 "2003-06-20T06:28:15Z")

</div>

instead of this code:

```auto
for (k=0; k<50; k++) {
	duplicateMovieClip(_root.snow, "snow"+k, k);
}

```

use this one:

```auto
var index, maxSnow = 50;
this.onEnterFrame = function() {
	if (++index<=maxSnow) snow.duplicateMovieClip("snow"+index, index);
	else delete this.onEnterFrame;
};

```

like 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:** [June 20, 2003, 7:05pm UTC](https://forum.kirupa.com/t/kirupas-snow-effect/23616/3 "2003-06-20T19:05:13Z")

</div>

1. How do I get it to come in even more gradually? Ideally, I want to start out with 1 snowflake.
2. How do I make the snow fall only in one specific area of my movie? IE X=300, Y=200, Height=100, Width=400.

---

<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:** [June 20, 2003, 10:16pm UTC](https://forum.kirupa.com/t/kirupas-snow-effect/23616/4 "2003-06-20T22:16:49Z")

</div>

1. the code i posted duplicates de snow at the fps of your movie, if you want it slower/faster you could set up a function to duplicate the snow and an interval to call the function.

```auto
var index, maxSnow = 50;
duplicateSnow = function() {
if (++index<=maxSnow) snow.duplicateMovieClip("snow"+index, index);
else clearInterval(snowInterval);
};
var snowInterval = setInterval(duplicateSnow, 1000/4);

```

that way it would be duplicated 4 times per second.

1. i already answered that question. i couldn’t find the stupid thread so here it is again. 😛

```auto
onClipEvent (load) {
	var xmin = 40, xmax = 140, ymin = 40, ymax = 240;
	i = 1+Math.random()*2;
	k = -Math.PI+Math.random()*Math.PI;
	this._xscale = this._yscale=50+Math.random()*100;
	this._alpha = 75+Math.random()*100;
	this._x = xmin+Math.random()*(xmax-xmin);
	this._y = ymin;
}
onClipEvent (enterFrame) {
	rad += (k/180)*Math.PI;
	this._x -= Math.cos(rad);
	this._y += i;
	if (this._y>=ymax || this._x<=xmin || this._x>=xmax) {
		this._x = xmin+Math.random()*(xmax-xmin);
		this._y = ymin;
	}
}

```

change the xmin, xmax, ymin and ymax values to whatever you need. 😉

---

<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:** [July 10, 2003, 4:38pm UTC](https://forum.kirupa.com/t/kirupas-snow-effect/23616/5 "2003-07-10T16:38:37Z")

</div>

All your code worked. Thanks.

How do you get the snow to appear on the actual layer that I put it on? It appears as the top layer and blocks a bunch of stuff on my site.

---

<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:** [July 10, 2003, 8:42pm UTC](https://forum.kirupa.com/t/kirupas-snow-effect/23616/6 "2003-07-10T20:42:05Z")

</div>

yes, i’m having a similar problem with dublicating movie clips. how can i get them to appear below stuff?

to see the actual file i’m talking about, go here [www.coppertop.0catch.com/flash/hovercraft.htm](http://www.coppertop.0catch.com/flash/hovercraft.htm)  
(could do me a favour and visit the main site as well? please :beam:)

---

<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:** [July 11, 2003, 3:45pm UTC](https://forum.kirupa.com/t/kirupas-snow-effect/23616/7 "2003-07-11T15:45:14Z")

</div>

… 😛

---

<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:** [July 11, 2003, 4:39pm UTC](https://forum.kirupa.com/t/kirupas-snow-effect/23616/8 "2003-07-11T16:39:22Z")

</div>

There’s only **\>\>** [one site](http://www.yourethemannowdog.com/) **\<\<** that can sum up your greatness. 🙂

---

<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:** [July 11, 2003, 4:41pm UTC](https://forum.kirupa.com/t/kirupas-snow-effect/23616/9 "2003-07-11T16:41:21Z")

</div>

^^ 😛
