# Trying to covert kirupa snow to as3

**URL:** <https://forum.kirupa.com/t/trying-to-covert-kirupa-snow-to-as3/274178>\
**Category:** Uncategorized\
**Created:** [October 26, 2008, 5:15pm UTC](https://forum.kirupa.com/t/trying-to-covert-kirupa-snow-to-as3/274178 "2008-10-26T17:15:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RossKidd](https://avatars.discourse-cdn.com/v4/letter/r/53a042/32.png) [@RossKidd](https://forum.kirupa.com/u/RossKidd)\
**Post date:** [October 26, 2008, 5:15pm UTC](https://forum.kirupa.com/t/trying-to-covert-kirupa-snow-to-as3/274178/1 "2008-10-26T17:15:13Z")

</div>

hi am trying to convert this to as3

[http://www.kirupa.com/developer/flash8/snow.htm](http://www.kirupa.com/developer/flash8/snow.htm)

I think I am getting close, below is what I have so far can anyone help?

init = function () {  
width = 300;  
// pixels  
height = 200;  
// pixels  
max\_snowsize = 10;  
// pixels  
snowflakes = 50;  
// quantity

var snowArray:Array = new Array();

for (i=0; i\<snowflakes; i++)  
{

```
var myflake = new snow();
addChild(myflake);

    myflake.alpha = 20+Math.random()*60;
    myflake.x = -(width/2)+Math.random()*(1.5*width);
    myflake.y = -(height/2)+Math.random()*(1.5*height);
    myflake.scaleX = myflake.scaleY=50+Math.random()*(max_snowsize*10);
    myflake.k = 1+Math.random()*2;
    myflake.wind = -1.5+Math.random()*(1.4*3);
    myflake.addEventListener(Event.ENTER_FRAME, mover);
    
}

```

};

function mover(event:Event) {

myflake.y += this.k;  
myflake.x += this.wind;  
if (myflake.y\>height+10) {  
myflake.y = -20;  
}  
if (myflake.x\>width+20) {  
myflake.x = -(width/2)+Math.random()_(1.5_width);  
myflake.y = -20;  
} else if (myflake.x\<-20) {  
myflake.x = -(width/2)+Math.random()_(1.5_width);  
myflake.y = -20;  
}  
}  
init();
