# Falling Snow Based Animation

**URL:** <https://forum.kirupa.com/t/falling-snow-based-animation/103699>\
**Category:** Uncategorized\
**Created:** [March 8, 2004, 12:39pm UTC](https://forum.kirupa.com/t/falling-snow-based-animation/103699 "2004-03-08T12:39:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![as\_clark20](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@as\_clark20](https://forum.kirupa.com/u/as_clark20)\
**Post date:** [March 8, 2004, 12:39pm UTC](https://forum.kirupa.com/t/falling-snow-based-animation/103699/1 "2004-03-08T12:39:47Z")

</div>

Hi all,

I have an animation based upon the excellent falling snow tutorial. My animation is falling leaves. Now, in the falling snow tutorial random rotation wasn’t a problem because all the objects were circles. I’d really like randomness in the leaves, I’ve added a line of code to the original AS - it should be in bold… am I on the right track?

onClipEvent (load) {  
// specifies the size of the movie stage  
movieWidth = 600;  
movieHeight = 500;  
// variables that will modify the falling leaves  
i = 1+Math.random()\*2;  
k = -Math.PI+Math.random()\*Math.PI;  
// giving each leaf unique characteristics  
this.\_xscale = this.\_yscale=50+Math.random()\*100;  
\*_this.\_rotation = this.\_rotation=360+Math.random()100;_  
this.\_alpha = 60+Math.random()\*100;  
this.\_x = -15+Math.random()\*movieWidth;  
this.\_y = -15+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.\_x\>=movieWidth) || (this.\_x\<=0)) {  
this.\_x = -10+Math.random()\*movieWidth;  
this.\_y = -5;  
}  
}

What can I say I’m just not a coder.
