[Flash 8]
Hi,
I attached some movies based on an array pulled from an XML file. eg.
for (var k=0; k < accountArray.length; k++){
var thisAcc:MovieClip = _root.ledgerContent.attachMovie(“accLedger_mc”,“accountMC”+k,_global.cDepth);
Now I want to do a hitTest on each of them when a dragged movieclip is released. How do I put a variable into a target path so that I can create a loop for the length of the array? eg.
for (e=0; e < accountArray.length; e++){
if (draggedLoc == null){
if (ledgerContent.accountMC[COLOR=red]e[/COLOR].credit.hitTest(_root.dragable1.dragBut)) {
draggedLoc = “credit”;
trace (“Dragged to “+accountArray[e][1]+” - credit”);
} else if (ledgerContent.accountMC[COLOR=red]e[/COLOR].debit.hitTest(_root.dragable1.dragBut)) {
trace (“Dragged to “+accountArray[e][1]+” - debit”);
draggedLoc = “debit”;
} else {
draggedLoc = null;
}
}
}
The above doesn’t work of course.