# Drawing api help needed

**URL:** <https://forum.kirupa.com/t/drawing-api-help-needed/196253>\
**Category:** flash\
**Created:** [August 7, 2006, 5:30am UTC](https://forum.kirupa.com/t/drawing-api-help-needed/196253 "2006-08-07T05:30:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajcates](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ajcates/32/2435_2.png) [@ajcates](https://forum.kirupa.com/u/ajcates)\
**Post date:** [August 7, 2006, 5:30am UTC](https://forum.kirupa.com/t/drawing-api-help-needed/196253/1 "2006-08-07T05:30:07Z")

</div>

function box(size, boxName) {  
trace(boxName+size);  
\_root.createEmptyMovieClip(boxName, \_root.getNextHighestDepth());  
boxName.lineStyle(10);  
boxName.lineTo(size, 0);  
boxName.lineTo(size, size);  
boxName.lineTo(0, size);  
boxName.lineTo(0, 0);  
}  
function randRange(min:Number, max:Number):Number {  
var randomNum:Number = Math.floor(Math.random()\*(max-min+1))+min;  
return randomNum;  
}  
for (i=0; i\<15; i++) {  
boxTarget = “box”+i+"\_mc";  
box(80, boxTarget);  
boxTarget.\_x = randRange(0, Stage.width);  
boxTarget.\_y = randRange(0, Stage.height);  
trace(boxTarget);  
}

it don’t work,i want it to draw 15 boxes and then place them in random areas on the stage,then i want to make them rotate,my function to draw a box wont work at all, i don’t know why,the function gets called and traces the right stuff, thx for the help
