# Why does this return undefined?

**URL:** <https://forum.kirupa.com/t/why-does-this-return-undefined/126396>\
**Category:** Uncategorized\
**Created:** [October 22, 2004, 8:42pm UTC](https://forum.kirupa.com/t/why-does-this-return-undefined/126396 "2004-10-22T20:42:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rasper](https://avatars.discourse-cdn.com/v4/letter/r/9fc29f/32.png) [@Rasper](https://forum.kirupa.com/u/Rasper)\
**Post date:** [October 22, 2004, 8:42pm UTC](https://forum.kirupa.com/t/why-does-this-return-undefined/126396/1 "2004-10-22T20:42:21Z")

</div>

Hello, i’m loading some data from an xml-file and dynamically create movieclips with textfields inside of them, but I’m kinda stuck.  
I’m not up to the point where I completely understand how you can refer to a nested object using this syntax: \_root[movieClipName].  
If you want to nest something inside of that movieclip, you have to work like this:

[size=1]ClipHolder = \_root[movieClipName][/size]  
[size=1]item = “catClip”[/size]  
[size=1]ClipHolder[item];[/size]

But if you decide to add something to that clip, you have to do the same thing over again:

[size=1]var ClipHolder = \_root[movieClipName];[/size]  
[size=1]var item = “catClip”;[/size]  
[size=1][color=darkred]var PlaceHolder =[/color] ClipHolder[item];[/size]  
[size=1][color=darkred]var newItem = “eyes”;[/color][/size]  
[size=1][color=darkred]PlaceHolder[newItem];[/color][/size]

[color=black]I absolutely hate this way of working, because it doesn’t add to the clarity of my code :\*( . If you have a lot of nested clips, this becomes extremely elaborate. Isn’t there another way to do this?[/color]

Now to the problem at hand, the following code traces [font=Courier New]undefined [/font][font=Verdana]and I can’t figure out why. Can anyone help me please? :puzzled: [/font]

```auto
for(i = 0; i < this.firstChild.childNodes.length; i++){
movieMain.naam = this.firstChild.childNodes*.childNodes[0].firstChild.nodeValue; 
movieMain.linkLijst.createEmptyMovieClip(movieMain.naam, i);
 
urlHolder = movieMain.linkLijst[movieMain.naam];
trace(urlHolder); //returns the movieClip
 
textHolder = "txt_" + movieMain.naam;
urlHolder.createTextField(textHolder, 0);
trace(urlHolder[textHolder]); //returns undefined
}

```

Thanks in advance!
