# Display Objects and nested movie clips

**URL:** <https://forum.kirupa.com/t/display-objects-and-nested-movie-clips/304603>\
**Category:** flash\
**Created:** [February 10, 2010, 6:16pm UTC](https://forum.kirupa.com/t/display-objects-and-nested-movie-clips/304603 "2010-02-10T18:16:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ligaa](https://avatars.discourse-cdn.com/v4/letter/l/f19dbf/32.png) [@ligaa](https://forum.kirupa.com/u/ligaa)\
**Post date:** [February 10, 2010, 6:16pm UTC](https://forum.kirupa.com/t/display-objects-and-nested-movie-clips/304603/1 "2010-02-10T18:16:33Z")

</div>

Hey all,

Can anyone give a good, accurate description of the relationship between the Display Object hierarchy and nested movie clips?

Here’s my issue: I have a movie clip, that has a few movie clips and text fields inside of it. I need access to those MCs and text fields.  
So, I start off with **stage.addChild(container\_mc)**. (These are just examples, by the way)  
Then I do **container\_mc.addChild(movieOne\_mc)**, **container\_mc.addChild(movieTwo\_mc)**, and **container\_mc.addChild(textOne\_txt)**.  
I’ve made sure to import the necessary classes and declare my variables accordingly.

Now I need to access the stuff inside the container. Let’s say I need to change what the text box says.  
So I try **container\_mc.textOne\_txt.text = “Hello, world!”;**  
That throws an error, so I try **parent.container\_mc.textOne\_txt.text = “Hello, world!”;**  
That throws an error, too. So I try **MovieClip(parent).container\_mc.textOne\_txt.text = “Hello, world!”;**  
That throws an error… Finally, I try **MovieClip(parent.container\_mc).textOne\_txt.text = “Hello, world!”;**  
And then I give up and come here.

I’ve had this work before, but only by referencing the name of the movie clips in question.  
Ex: **MovieClip(parent.getChildByName(currentVideo.toString())).gotoAndStop(2);**  
Is that the only way to access nested movie clips? I don’t mind giving every single object a name if I have to, I’m just failing to understand if this is the right way to do things or not. And I foresee issues in the future with objects that aren’t movie clips, or with dynamically generated objects.

The only “tutorials” on Display Objects and similar situations such as this that I’ve seen only show the Display Object hierarchy. Is there a more robust collection of information on working with nested movie clips in Actionscript 3 out there, complete with examples?

Any help or further insight would be greatly appreciated.
