# Accessing children of dynamically added MC

**URL:** <https://forum.kirupa.com/t/accessing-children-of-dynamically-added-mc/318023>\
**Category:** Uncategorized\
**Created:** [January 8, 2011, 1:06pm UTC](https://forum.kirupa.com/t/accessing-children-of-dynamically-added-mc/318023 "2011-01-08T13:06:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryancole](https://avatars.discourse-cdn.com/v4/letter/r/b38774/32.png) [@ryancole](https://forum.kirupa.com/u/ryancole)\
**Post date:** [January 8, 2011, 1:06pm UTC](https://forum.kirupa.com/t/accessing-children-of-dynamically-added-mc/318023/1 "2011-01-08T13:06:38Z")

</div>

ggrrrr. This is making me crazy.

```auto
function saveAction(evt:MouseEvent):void{
    var choice=evt.target.name;
    var inputText:String = saveName.text;
}

```

I have this and I am trying to make a variable from the contents of the input box. Simple ya? The issue is that it is a child of another clip that is being added dynamically, so it doesn’t think the input exists. How do I declare the input? How can I target it’s contents?

Also I have a remove function that is meant to remove this same parent clip.

```auto
function closeSaveWindow(evt:MouseEvent):void{
    removeChild(saver);
}

```

‘saver’ is a variable created in another function, so I think there is a scope issue there. To try to fix that I declared ‘saver’ as a movie clip as a global var.

help please!

☹
