# Boxes and more boxes

**URL:** <https://forum.kirupa.com/t/boxes-and-more-boxes/175419>\
**Category:** contests\
**Created:** [January 14, 2006, 4:59am UTC](https://forum.kirupa.com/t/boxes-and-more-boxes/175419 "2006-01-14T04:59:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![esnetni](https://avatars.discourse-cdn.com/v4/letter/e/b5a626/32.png) [@esnetni](https://forum.kirupa.com/u/esnetni)\
**Post date:** [January 14, 2006, 4:59am UTC](https://forum.kirupa.com/t/boxes-and-more-boxes/175419/1 "2006-01-14T04:59:22Z")

</div>

Here is my entry:tie:

```auto
_root.createEmptyMovieClip("square", 0); 
square.beginFill(0x0), square.moveTo(10, 10), square.lineTo(10, 10), square.lineTo(10, 20), square.lineTo(20, 20), square.lineTo(20, 10), square.endFill(); 
square._x=Stage.width/2, square._y=Stage.height/2; 
square.onRollOver = function() { 
genParts(this); 
}; 
function genParts(ob) { 
ob.useHandCursor = false; 
var cl:Color = new Color(ob), clr = "0x"+random(999999); 
cl.setRGB(clr); 
for (var i:Number = 0; i<random(5);i++){ ob.duplicateMovieClip("s"+i, _root.getNextHighestDepth(), {_alpha:random(75)+25, _rotation:random(359), spd:random(10)+20, _x:ob._x+random(10), _y:ob._y+random(10), onEnterFrame:function () { 
this.spd<=1 ? delete this.onEnterFrame : null, this._x += Math.sin(this._rotation*(Math.PI/180))*(this.spd *= .8), this._y -= Math.cos(this._rotation*(Math.PI/180))*this.spd; 
}, onRollOver:function () { 
genParts(this); 
}}); 
} 
} 

```
