Thanks for your help cancerinform, however I've found a really simple way of doing it:
It was the "if (checkoutSlotsArray[i].name == evt.target.parent.name)" that I was really looking for. Thanks again!Code:function clearSlot(evt:MouseEvent):void { var spacer:int = 44.1;// set this to the height of each item evt.target.parent.parent.removeChild(evt.target.parent); for (var i:int = 0; i < checkoutSlotsArray.length; i++) { if (checkoutSlotsArray[i].name == evt.target.parent.name) { checkoutSlotsArray.splice(i, 1); } } for (var j:int = 0; j < checkoutSlotsArray.length; j++) { checkoutSlotsArray[j].y = j*spacer; } }




Reply With Quote