# Falling snow -\> Rising bubbles

**URL:** <https://forum.kirupa.com/t/falling-snow-rising-bubbles/143415>\
**Category:** Uncategorized\
**Created:** [April 5, 2005, 7:41pm UTC](https://forum.kirupa.com/t/falling-snow-rising-bubbles/143415 "2005-04-05T19:41:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bohner](https://avatars.discourse-cdn.com/v4/letter/b/54ee81/32.png) [@Bohner](https://forum.kirupa.com/u/Bohner)\
**Post date:** [April 5, 2005, 7:41pm UTC](https://forum.kirupa.com/t/falling-snow-rising-bubbles/143415/1 "2005-04-05T19:41:17Z")

</div>

Hi.

Im trying to edit this AS to imitate the bubbles in a fizzy drink. I almost got it, but the bubbles just don’t spawn all the time. Whats wrong ?

[http://bohner.asdf.pl/misc/bubbles\_1.fla](http://bohner.asdf.pl/misc/bubbles_1.fla)

onClipEvent (load) {  
//variables  
width = 300;  
height = 200;  
//random x,y, and alpha  
this.\_xscale = this.\_yscale=50+Math.random()_100;  
this.\_alpha = 20+Math.random()50;  
//random x and y for flakes  
this.\_x = -width+Math.random()(3_width);  
this.\_y = -10+Math.random()\*height;  
//speed and trigonometric value  
i = 1+Math.random()\*10;  
k = -Math.PI+Math.random()_Math.PI;  
rad = 0;  
}  
onClipEvent (enterFrame) {  
// horizontal movement  
rad += (k/10)Math.PI;  
xmovement = \_root.\_xmouse;  
this.\_x -= Math.cos(rad)+(xmovement-(width/2))/100;  
// vertical movement  
this.\_y -= i;  
// remove clips when they misbehave (overstep boundaries)  
if (this.\_x\>(width+50)) {  
this.\_x = -45;  
this.\_y = Math.random()height2;  
}  
if (this.\_x\<-50) {  
this.\_x = width+45;  
this.\_y = Math.random()height2;  
}  
if (this.\_y\>=height) {  
this.\_y = -50;  
this.\_x = -width+Math.random()(3_width);  
}  
}
