Hi All,
I like to place lets say 4 movieclips on the stage with a random x-axis, but with no overlap, and if possible also not outside the borders of the stage. Performing the hit test would be not to hard, but then perfomring it again untill it is true, that is the tricky part (for me:emb:).
On the other hand I just want to place them visually random on stage, but infact they need to be more or less evenly distributed over the stage width, so maybe another solution is easier?
part of the code:
else if((i > spacery) && (i <= spacery*2)) {
[COLOR=DarkRed]container.x = Math.floor(Math.random()*800);
if (if (container.hitTestObject(container)){
container.x = Math.floor(Math.random()*800);//????
}[/COLOR]
container.y = 400;
addChild(container);
}
Any help is welcome,
Thanks