# Targetting attached movies

**URL:** <https://forum.kirupa.com/t/targetting-attached-movies/215917>\
**Category:** flash\
**Created:** [February 12, 2007, 4:23am UTC](https://forum.kirupa.com/t/targetting-attached-movies/215917 "2007-02-12T04:23:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aasha](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@Aasha](https://forum.kirupa.com/u/Aasha)\
**Post date:** [February 12, 2007, 4:23am UTC](https://forum.kirupa.com/t/targetting-attached-movies/215917/1 "2007-02-12T04:23:42Z")

</div>

[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.
