# Falling snow effect

**URL:** <https://forum.kirupa.com/t/falling-snow-effect/64091>\
**Category:** Uncategorized\
**Created:** [September 13, 2004, 7:00am UTC](https://forum.kirupa.com/t/falling-snow-effect/64091 "2004-09-13T07:00:54Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![saint\_cleve](https://avatars.discourse-cdn.com/v4/letter/s/958977/32.png) [@saint\_cleve](https://forum.kirupa.com/u/saint_cleve)\
**Post date:** [September 13, 2004, 7:00am UTC](https://forum.kirupa.com/t/falling-snow-effect/64091/1 "2004-09-13T07:00:54Z")

</div>

how do i stop it?

---

<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:** [September 13, 2004, 7:38am UTC](https://forum.kirupa.com/t/falling-snow-effect/64091/2 "2004-09-13T07:38:57Z")

</div>

you send the playhead to another frame that doesnt have the snow on it.

---

<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:** [September 13, 2004, 8:12am UTC](https://forum.kirupa.com/t/falling-snow-effect/64091/3 "2004-09-13T08:12:34Z")

</div>

i tried that…but it just keeps snowing…

---

<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:** [September 13, 2004, 8:16am UTC](https://forum.kirupa.com/t/falling-snow-effect/64091/4 "2004-09-13T08:16:14Z")

</div>

lol, you mean you tell flash to go to another frame where there is no actionscript and no movieclip on the stage and theres STILLL snow??? i dunno bro, post that file, this could be flash history. hehehe.

---

<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:** [September 13, 2004, 8:43am UTC](https://forum.kirupa.com/t/falling-snow-effect/64091/5 "2004-09-13T08:43:29Z")

</div>

ok…its the falling snow tutorial i used from kirupa…ill post it…but be warned…its not finished yet…so if the character might get stuck somewhere…

---

<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:** [September 13, 2004, 8:46am UTC](https://forum.kirupa.com/t/falling-snow-effect/64091/6 "2004-09-13T08:46:06Z")

</div>

[![](http://pic.photobucket.com/bwe.png) ](http://pic.photobucket.com/bwe.png)

its only supposed to snow on the first frame…

it was origianlaly supposed to snow in the frame that was all snow…but it just kept snowing…so i just tossed it on the firts frame…

---

<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:** [September 13, 2004, 9:09am UTC](https://forum.kirupa.com/t/falling-snow-effect/64091/7 "2004-09-13T09:09:23Z")

</div>

it seems you are using actionscript to duplicate snow flakes and animating them.

in the main flake movieclip, put a check for a global var

like \_root.isSnowing

so if that is false, the flake will stop .

---

<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:** [September 13, 2004, 9:15am UTC](https://forum.kirupa.com/t/falling-snow-effect/64091/8 "2004-09-13T09:15:33Z")

</div>

could you detail that a little better…i dont really know what i am doing…that does make sense…just how do i put it in my script…

---

<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:** [September 13, 2004, 8:30pm UTC](https://forum.kirupa.com/t/falling-snow-effect/64091/9 "2004-09-13T20:30:57Z")

</div>

I mentioned this on AIM, but for archival purposes I’ll post my suggestion. Try placing all of your code in an if statement that checks to see if you are on your first frame:

```auto
 
if (_root._currentframe ==1) {
everything else
}

```

🙂

---

<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:** [September 13, 2004, 8:44pm UTC](https://forum.kirupa.com/t/falling-snow-effect/64091/10 "2004-09-13T20:44:39Z")

</div>

here is what i have…

```auto

if (_root._currentframe ==1) {
onClipEvent (load) {
	
	movieWidth = 300;
	movieHeight = 200;
	
	
	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 = -10+Math.random()*movieWidth;
	this._y = -10+Math.random()*movieHeight;
}
onClipEvent (enterFrame) {
	
        rad += (k/180)*Math.PI;
	this._x -= Math.cos(rad);
	this._y += i;
	if (this._y>=movieHeight) {
		this._y = -5;
	}
	if ((this._x>=movieWidth) || (this._x<=0)) {
		this._x = -10+Math.random()*movieWidth;
		this._y = -5;
	}
}
}

```

here is the error message…

```auto

**Error** Scene=Scene 1, layer=bg...over, frame=3:Line 2: Statement must appear within on/onClipEvent handler
     if (_root._currentframe ==1) {

```

and here is what i did…to get rid of the message…  
and now the snow wont even fall…

```auto

onClipEvent (load) {
if (_root._currentframe ==1) {
	//specifies the size of the movie stage
	movieWidth = 300;
	movieHeight = 200;
	
	//variables that will modify the falling snow
	i = 1+Math.random()*2;
	k = -Math.PI+Math.random()*Math.PI;
	
	//giving each snowflake unique characteristics
	this._xscale = this._yscale=50+Math.random()*100;
	this._alpha = 75+Math.random()*100;
	this._x = -10+Math.random()*movieWidth;
	this._y = -10+Math.random()*movieHeight;
}

	//putting it all together
	rad += (k/180)*Math.PI;
	this._x -= Math.cos(rad);
	this._y += i;
	if (this._y>=movieHeight) {
		this._y = -5;
	}
	if ((this._x>=movieWidth) || (this._x<=0)) {
		this._x = -10+Math.random()*movieWidth;
		this._y = -5;
	}
}

```
