# How to make this for as3

**URL:** <https://forum.kirupa.com/t/how-to-make-this-for-as3/332136>\
**Category:** Uncategorized\
**Created:** [February 12, 2014, 3:02pm UTC](https://forum.kirupa.com/t/how-to-make-this-for-as3/332136 "2014-02-12T15:02:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aldo\_tanku](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@aldo\_tanku](https://forum.kirupa.com/u/aldo_tanku)\
**Post date:** [February 12, 2014, 3:02pm UTC](https://forum.kirupa.com/t/how-to-make-this-for-as3/332136/1 "2014-02-12T15:02:58Z")

</div>

var depthLevel = 3000;  
var boxCounter = 1;  
var curr\_box;  
dropTimer = setInterval(createBox, 1000);

function createBox()  
{  
curr\_box = cloudLayer.attachMovie(“box”, “” + boxCounter, depthLevel);  
curr\_box.\_x = 800;  
curr\_box.\_y = Math.random() \* 420;  
curr\_box.\_xscale = curr\_box.\_yscale = 90;  
curr\_box.speed = 15;  
boxCounter += 1;  
depthLevel += 1;  
curr\_box.onEnterFrame = boxMove;  
}  
function boxMove()  
{  
this.\_x -= this.speed;  
}
