# Multiple nested movieclip access problem

**URL:** <https://forum.kirupa.com/t/multiple-nested-movieclip-access-problem/260249>\
**Category:** Uncategorized\
**Created:** [May 13, 2008, 7:53pm UTC](https://forum.kirupa.com/t/multiple-nested-movieclip-access-problem/260249 "2008-05-13T19:53:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![prabaldey](https://avatars.discourse-cdn.com/v4/letter/p/8e8cbc/32.png) [@prabaldey](https://forum.kirupa.com/u/prabaldey)\
**Post date:** [May 13, 2008, 7:53pm UTC](https://forum.kirupa.com/t/multiple-nested-movieclip-access-problem/260249/1 "2008-05-13T19:53:29Z")

</div>

Hello,

I have created a file which has a movieclip named mc\_shape on the first frame. Inside mc\_shape, I have mc\_shape1 on the first frame, mc\_shape2 on the second frame and mc\_shape3 on the third frame (all instances of different movieclips). There is no stop(); on any of the frames

Now, I am trying to access the inner movieclips with the following code on the main timeline:

import flash.events.Event ;  
mc\_shape.addEventListener(Event.ENTER\_FRAME, showData) ;  
function showData(e:Event) {  
if(mc\_shape.currentFrame == 1){  
trace("Shape 1: " + mc\_shape.mc\_shape1) ;  
}  
if(mc\_shape.currentFrame == 2){  
trace("Shape 2: " + mc\_shape.mc\_shape2) ;  
}  
if(mc\_shape.currentFrame == 3){  
trace("Shape 3: " + mc\_shape.mc\_shape3) ;  
}  
}

Now, when I run the program, it gives me null for mc\_shape1 and mc\_shape2 but returns a movieclip reference for mc\_shape3. I ran the file in debug mode and found that only mc\_shape3 is getting recognized as a movieclip in the variables window while the others have null against them.

I then added a mc\_shape4 to the main clip (so, now, mc\_shape had 4 frames with a child movie clip on each frame). When I run that file, I only get a reference of mc\_shape4 and all others are null.

Seems like CS3 is only recognizing the last frame’s movie clip. Any idea what is going on here? I do need to access each movieclip individually. There is no other option. But I don’t know where I am going wrong.

Thanks in advance for your replies.
