# Flying pollen

**URL:** <https://forum.kirupa.com/t/flying-pollen/309979>\
**Category:** flash\
**Created:** [May 28, 2010, 11:26pm UTC](https://forum.kirupa.com/t/flying-pollen/309979 "2010-05-28T23:26:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nene\_86](https://avatars.discourse-cdn.com/v4/letter/n/43a26b/32.png) [@nene\_86](https://forum.kirupa.com/u/nene_86)\
**Post date:** [May 28, 2010, 11:26pm UTC](https://forum.kirupa.com/t/flying-pollen/309979/1 "2010-05-28T23:26:01Z")

</div>

Hi everyone!  
I’m using the tutorial to create falling snow for flying pollen but I have a problem. How can I make the particles go in the opposite direction, from the bottom to the top of the stage.

This is the code:

onClipEvent (load) {  
//specifies the size of the movie stage  
movieWidth = 300;  
movieHeight = 200;

```
//variables that will modify the falling snow
i = 1+Math.random()*2;
k = -Math.PI+Math.random()*Math.PI;

//giving each snowflake unique characteristics
this._xscale = this._yscale=50+Math.random()*100;
this._alpha = 75+Math.random()*100;
this._x = -10+Math.random()*movieWidth;
this._y = -10+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;  
}  
}

Thanks a lot  
(and sorry for my bad english, I’m an italian girl).
