I have a loop MC which will be duplicate to stage several times according to every click. Now I want to detect if the MC being click belongs to which position in the array.
private function levelsBG():void {
LIST = new MovieClip();
d++;
for (var i:Number=0; i<myXML.children().length(); i++) {
listMC=new MovieClip();
LIST.addChild(listMC);
listMC.addEventListener(MouseEvent.CLICK,listClick);
}
listArray.push(LIST);
LISTmc.addChild(LIST);
addChild(LISTmc);
}
private function listClick(event:MouseEvent):void {
var currentListArray=listArray[listArray.length-1];
//trace from which position of Array
trace(listArray.length-event.target.parent)
}