# Trying to stop a function snow 3.0

**URL:** https://forum.kirupa.com/t/trying-to-stop-a-function-snow-3-0/295781
**Category:** flash
**Created:** [September 4, 2009, 3:28am UTC](https://forum.kirupa.com/t/trying-to-stop-a-function-snow-3-0/295781 "2009-09-04T03:28:40Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![chockybickyman](https://avatars.discourse-cdn.com/v4/letter/c/7bcc69/32.png) [@chockybickyman](https://forum.kirupa.com/u/chockybickyman)
#### Post date: [September 4, 2009, 3:28am UTC](https://forum.kirupa.com/t/trying-to-stop-a-function-snow-3-0/295781/1 "2009-09-04T03:28:40Z")

</div>

heres the code, that is currently sitting in the \_root timeline.

init = function () {  
width = 1400;  
// pixels  
height = 890;  
// pixels  
max\_snowsize = 20;  
// pixels  
snowflakes = 40;  
// 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();

I was hoping to then stop this function when it goes to the 3rd frame on \_root timeline. Seems to keep going when you are frame 3.
