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