# Reference a dynamic movieclip from an outside movieclip

**URL:** https://forum.kirupa.com/t/reference-a-dynamic-movieclip-from-an-outside-movieclip/305232
**Category:** flash
**Created:** [February 22, 2010, 12:19am UTC](https://forum.kirupa.com/t/reference-a-dynamic-movieclip-from-an-outside-movieclip/305232 "2010-02-22T00:19:50Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![tykebikemike](https://avatars.discourse-cdn.com/v4/letter/t/cc9497/32.png) [@tykebikemike](https://forum.kirupa.com/u/tykebikemike)
#### Post date: [February 22, 2010, 12:19am UTC](https://forum.kirupa.com/t/reference-a-dynamic-movieclip-from-an-outside-movieclip/305232/1 "2010-02-22T00:19:50Z")

</div>

Hey everybody  
i have created a movieclip (parentMC) that houses two movieclips within it (childA and childB)

in childA, i am dynamically creating movieclips via a loop:

```auto

var newX = 0;
var pagTotal = 8;

for(i=1; i<pagTotal+1; i++){
    var pagMC:MovieClip = this.attachMovie('btnPag0'+i, 'pagClip0'+i, this.getNextHighestDepth());    
    
    var pagMC_w = pagMC._width;
    var total_w = pagMC_w * pagTotal - pagMC_w;
    
    pagMC._x = newX - total_w/2;
    pagMC._y = 5;
} 

```

…and in childB i’m trying to reference one of these created movieclips via “\_parent.childA.pagClip01” so on and so forth.

but they dont seem to be working. when i trace the dynamic clip from within childB i keep getting “undefined” in the output. however, I can reference the movieclip from within childA, and even from parentMC no problem.

i’ve used \_root and \_level0 absolute paths and still the same failed result. any help is appreciated!
