# Displaying XML Data in Nested Movie Clips

**URL:** https://forum.kirupa.com/t/displaying-xml-data-in-nested-movie-clips/296709
**Category:** flash
**Created:** [September 18, 2009, 5:05pm UTC](https://forum.kirupa.com/t/displaying-xml-data-in-nested-movie-clips/296709 "2009-09-18T17:05:18Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![RedPenguin](https://avatars.discourse-cdn.com/v4/letter/r/b5a626/32.png) [@RedPenguin](https://forum.kirupa.com/u/RedPenguin)
#### Post date: [September 18, 2009, 5:05pm UTC](https://forum.kirupa.com/t/displaying-xml-data-in-nested-movie-clips/296709/1 "2009-09-18T17:05:18Z")

</div>

Hello Everyone,

I’m attempting to create a movie where 100 different facts are faded in and out sequentially. The text will need to be updated monthly so I figured I’d use the dynamic text feature along with an XML file to streamline the updating process.

I’ve worked through Kirupa’s[SIZE=2] [**[FONT=Verdana][COLOR=#003366]Displaying[/COLOR][/FONT]**[/SIZE][FONT=Verdana][SIZE=2][COLOR=#003366][URL=“http://www.kirupa.com/developer/actionscript/xmldataflash.htm”]\*\* XML Data in Flash\*\*](http://www.kirupa.com/developer/actionscript/xmldataflash.htm) tutorial (which was very well presented) and was able to get it to work while understanding the theory of how it worked. However I can’t seem to get it to function[/COLOR][/SIZE][/FONT][FONT=Verdana][SIZE=2][COLOR=#003366] when applied to my particular application[/COLOR][/SIZE][/FONT][FONT=Verdana][SIZE=2][COLOR=#003366].

After 4 hours of troubleshooting, I think I’ve isolated the problem to the actionscript component: I think (and I could be wrong) that something needs to reference the nested movieClip that contains the dynamic text layer. It works fine if everything happens on the first frame of the _root timeline. But any elements that I try to bury within a movie clip fail to display. I’m using the code from the tutorial as follows:  
[/COLOR][/SIZE][/FONT][FONT=Verdana][SIZE=2][COLOR=#003366]_\_\_\_**[/COLOR][/SIZE][/FONT][FONT=Verdana][SIZE=2][COLOR=#003366]**[/COLOR][/SIZE][/FONT][FONT=Verdana][SIZE=2][COLOR=#003366]\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_[/COLOR][/SIZE][/FONT]  
[FONT=Verdana][SIZE=2][COLOR=#003366]  
xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
xmlData.load(“content.xml”);

function loadXML(loaded) {

if (loaded) {

_root.inventor = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;  
 root.achievement = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;  
 root.nested = this.firstChild.childNodes[0].childNodes[2].firstChild.nodeValue;  
name\_txt.text = root.inventor;  
comment\_txt.text = root.achievement;  
nested\_txt.text = root.nested;  
} else {  
trace(“file not loaded!”);;  
}  
}  
[/COLOR][/SIZE][/FONT][FONT=Verdana][SIZE=2][COLOR=#003366]_**[/COLOR][/SIZE][/FONT][FONT=Verdana][SIZE=2][COLOR=#003366]****[/COLOR][/SIZE][/FONT][FONT=Verdana][SIZE=2][COLOR=#003366]**\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_[/COLOR][/SIZE][/FONT]

[FONT=Verdana][SIZE=2][COLOR=#003366]I’m a newb to actionscript and would appreciate any pointers. I’d be happy to post any example files if needed. [/COLOR][/SIZE][/FONT]  
[FONT=Verdana][SIZE=2][COLOR=#003366]  
Thanks!  
[/COLOR][/SIZE][/FONT]
