hello.
I have an movieClip form an array named object1 and another movieClip from another array named object2 and if object1 hit object2, both will remove.
my code is like this:
ActionScript Code:
var object1:Array = new Array;
var object2:Array = new Array;
for (var f:uint = 0; f < object1.length; f++)
{
for (var i:uint = 0; i < object2.length; i++)
{
if (object1[f].hitTestObject(object2[i]))
{
if (stage.contains(object1[f]))
{
removeChild(object1[f]);
}
if (stage.contains(object2[i]))
{
removeChild(object2[i]);
}
}
}
}
but my problem is when the two child from 2 arrays (object1 & object2) removeChild from stage they will be invisible not remove and functions for them won't be stop. so when the children increase to 100 or more stage speed slow down (because of huge number of children is stage). If anyone knows a solution for this please notice me.