# How to stop falling Snow

**URL:** <https://forum.kirupa.com/t/how-to-stop-falling-snow/187022>\
**Category:** flash\
**Created:** [April 26, 2006, 3:32am UTC](https://forum.kirupa.com/t/how-to-stop-falling-snow/187022 "2006-04-26T03:32:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DavisLim](https://avatars.discourse-cdn.com/v4/letter/d/b4bc9f/32.png) [@DavisLim](https://forum.kirupa.com/u/DavisLim)\
**Post date:** [April 26, 2006, 3:32am UTC](https://forum.kirupa.com/t/how-to-stop-falling-snow/187022/1 "2006-04-26T03:32:05Z")

</div>

Does anyone know how to stop a running function? I was using the below the scripts to create snow scene, it works but i dun now how to stop it.

init = function () {  
width = 630;  
// pixels  
height = 391;  
// pixels  
max\_snowsize = 10;  
// pixels  
snowflakes = 50;  
// quantity  
for (i=0; i\<snowflakes; i++) {  
t = attachMovie(“snow”, “snow”+i, i);  
t.\_alpha = 20+Math.random()_60;  
t.\_x = -(width/2)+Math.random()_(1.5_width);  
t.\_y = -(height/2)+Math.random()_(1.5_height);  
t.\_xscale = t.\_yscale=50+Math.random()_(max\_snowsize_10);  
t.k = 1+Math.random()2;  
t.wind = -1.5+Math.random()(1.4_3);  
t.onEnterFrame = mover;  
}  
};  
mover = function() {  
this.\_y += this.k;  
this.\_x += this.wind;  
if (this.\_y\>height+10) {  
this.\_y = -20;  
}  
if (this.\_x\>width+20) {  
this.\_x = -(width/2)+Math.random()_(1.5_width);  
this.\_y = -20;  
} else if (this.\_x\<-20) {  
this.\_x = -(width/2)+Math.random()_(1.5_width);  
this.\_y = -20;  
}  
}  
init ();

---

<div class="post-metadata">

**Author:** ![theHollow](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/thehollow/32/106_2.png) [@theHollow](https://forum.kirupa.com/u/theHollow)\
**Post date:** [April 26, 2006, 3:58am UTC](https://forum.kirupa.com/t/how-to-stop-falling-snow/187022/2 "2006-04-26T03:58:31Z")

</div>

just off the top of my head, before u run the above code create an empty movieclip and then change this:

t = attachMovie(“snow”, “snow”+i, i);

to this:

t = snowHolder\_mc.attachMovie(“snow”, “snow”+i, i); // assuming u called the empty mc snowHolder\_mc.

then use snowHolder\_mc.removeMovieClip();

it should work, but removeMov… will only work with a clip created using createEmptyMovieClip();

alternatively u could write a function with removes each snow mc one by one with a for loop.

---

<div class="post-metadata">

**Author:** ![DavisLim](https://avatars.discourse-cdn.com/v4/letter/d/b4bc9f/32.png) [@DavisLim](https://forum.kirupa.com/u/DavisLim)\
**Post date:** [April 26, 2006, 5:39am UTC](https://forum.kirupa.com/t/how-to-stop-falling-snow/187022/3 "2006-04-26T05:39:10Z")

</div>

Brendan, you’re the man. Your method is working. Thanks a million
