# Falling snow tut, modified

**URL:** <https://forum.kirupa.com/t/falling-snow-tut-modified/28067>\
**Category:** Uncategorized\
**Created:** [August 9, 2003, 5:24pm UTC](https://forum.kirupa.com/t/falling-snow-tut-modified/28067 "2003-08-09T17:24:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RussianBeer](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/russianbeer/32/152_2.png) [@RussianBeer](https://forum.kirupa.com/u/RussianBeer)\
**Post date:** [August 9, 2003, 5:24pm UTC](https://forum.kirupa.com/t/falling-snow-tut-modified/28067/1 "2003-08-09T17:24:21Z")

</div>

Okay, I remeber making this work at one point… but I forgot…

There is a Snowfalling tutorial here, I messed around with the code to make it instead of fall rise, the only proble is, that it rises from on point, and dosent appear random at the bottom, but from a single spot… anyway here is my AS.

onClipEvent (load) {  
//specifies the size of the movie stage  
movieWidth = 500;  
movieHeight = 200;

```
//variables that will modify the falling snow
k = 1+Math.random()*2;
i = -Math.PI+Math.random()*Math.PI;

//giving each snowflake unique characteristics
this._xscale = this._yscale=50+Math.random()*100;
this._alpha = 10+Math.random()*50;
this._x = -10+Math.random()*movieWidth;
this._y = -10+Math.random()*movieHeight;

```

}  
onClipEvent (enterFrame) {  
//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.\_y\>=movieWidth) || (this.\_y\<=33)) {  
this.\_y = +200;  
this.\_x = +200+Math.random()\*movieWidht;  
}  
}

---

<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:** [August 9, 2003, 6:35pm UTC](https://forum.kirupa.com/t/falling-snow-tut-modified/28067/2 "2003-08-09T18:35:26Z")

</div>

Hoi

i got this to work 😉

```auto

onClipEvent (load) {
	//specifies the size of the movie stage
	movieWidth = 200;
	movieHeight = 200;
	//variables that will modify the falling snow
	k = Math.random()*2;
	i = Math.PI+Math.random()*Math.PI;
	//giving each snowflake unique characteristics
	this._xscale = this._yscale=50+Math.random()*100;
	this._alpha = 10+Math.random()*50;
	this._x = Math.random()*movieWidth;
	this._y = movieHeight;
}
onClipEvent (enterFrame) {
	//putting it all together
	rad += (k/180)*Math.PI;
	this._x += Math.cos(rad);
	this._y -= i;
	if (this._y<=0 || this._x>=movieWidth || this._x<=0) {
		this._y = movieHeight;
		this._x = Math.random()*movieWidth;
	}
}

```

---

<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:** [August 9, 2003, 6:42pm UTC](https://forum.kirupa.com/t/falling-snow-tut-modified/28067/3 "2003-08-09T18:42:16Z")

</div>

gracias comarade!
