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]
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!