# How do I create snowfall movement

**URL:** <https://forum.kirupa.com/t/how-do-i-create-snowfall-movement/5239>\
**Category:** flash\
**Created:** [September 5, 2002, 2:22pm UTC](https://forum.kirupa.com/t/how-do-i-create-snowfall-movement/5239 "2002-09-05T14:22:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jer787](https://avatars.discourse-cdn.com/v4/letter/j/9e8a1a/32.png) [@Jer787](https://forum.kirupa.com/u/Jer787)\
**Post date:** [September 5, 2002, 2:22pm UTC](https://forum.kirupa.com/t/how-do-i-create-snowfall-movement/5239/1 "2002-09-05T14:22:23Z")

</div>

I would like to know how to create the continuous movement of snowfall without the dependency of the mouse (such as in the continuous movement tutorial). I tried the code for the simple movement, but I think it needs the ‘block’ in order to get it to continuously move. I don’t know how to write the code. Would anyone be able to help me with this? Thank you.

---

<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 5, 2002, 6:00pm UTC](https://forum.kirupa.com/t/how-do-i-create-snowfall-movement/5239/2 "2002-09-05T18:00:52Z")

</div>

this is some of the code from one my current projects:

onClipEvent (load) {  
speed = Math.random()\*2+0.1;  
this.\_y = Math.round(Math.random()\*76);  
this.\_alpha = Math.round(Math.random()\*25+5);  
this.\_xscale = Math.round(Math.random()\*100+50);  
this.\_yscale = this.\_xscale;

if (this.hitTest(\_root.reset)) {  
this.\_x = -150;  
speed = Math.random()\*2+0.1;  
this.\_y = Math.round(Math.random()\*76);  
this.\_alpha = Math.round(Math.random()\*25+5);  
this.\_xscale = Math.round(Math.random()\*100+50);  
this.\_yscale = this.\_xscale;  
}

when my moving object encounter a wall called “reset” on stage they are moved back (along the x\_axis) 150 pixles. They ten appear at random y\_axis values, with randome alpha values and scaling sizes all within the ranges defined in the code. This will produce a good snowfall effect - obviously youll swap the x reset for y and random y for random x. Also I’s add something (like a sine eq) so they float back and forth as well. Hope this gets you started.

Peace

PS I didnt mention it, but incase you over look it - you’ll obiously have to adjust the ranges I have put in after the Math.random() functions.
