Hello @ll;
I have problem with hitTesting duplicating movieClips.
What I am trying to do is duplicate MC(item) in random position _x & _y of the stage.
Problem is when they touch each other. How can I check if they are not touching each other and if so - move to position where they are not touching.
Here is the code so far:
_global.arrTitle = new Array ("value1", "value2", "value3", "value4", "value5", "value6", "value7", "value8");
total = arrTitle.length;
trace("total: "+total);
function randRange(min:Number, max:Number):Number {
var randomNum:Number = Math.floor(Math.random() * (max - min + 1)) + min;
return randomNum;
}
var dwidth:Number = Stage.width-100;
trace("teritory width: "+dwidth);
var dheight:Number = Stage.height-100;
trace("teritory height: "+dheight);
for (a=0; a<total; a++) {
mc = duplicateMovieClip("item", "item"+a, a+1);
//--------------------------------------//
var w:Number = randRange(0, dwidth)
trace("w: "+w);
var h:Number = randRange(0, dheight);
trace("h: "+h);
//-------------------------------------//
eval("item"+a)._x = w
eval("item"+a)._y = h
item._visible = false;
}
Many Thanks for HELP!!