is it possible to attach mcs at random locations without the possiblility of them overlapping?
much thanks
this also puts the mcs within the 600x400 movie.
[AS]var movieWidth = 600;
var movieHeight = 400;
var mcNUM = 10;
for (var i = 1; i<=mcNUM; i++) {
var mc = attachMovie(“myMC”, “mc”+i, i);
placeMovie(mc);
mc.id = i;
testHit(mc, i);
}
function placeMovie(mc) {
mc._x = mc._width/2+random(movieWidth-mc._width);
mc._y = mc._height/2+random(movieHeight-mc._height);
}
function testHit(mc, n) {
for (var j = 1; j<=n; j++) {
if (mc.hitTest(this[“mc”+j]) && mc.id != j) {
placeMovie(mc);
testHit(mc, n);
}
}
}[/AS]