# Loading xml

**URL:** https://forum.kirupa.com/t/loading-xml/190012
**Category:** Uncategorized
**Created:** [June 8, 2006, 1:15am UTC](https://forum.kirupa.com/t/loading-xml/190012 "2006-06-08T01:15:57Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![certainfate](https://avatars.discourse-cdn.com/v4/letter/c/b3f665/32.png) [@certainfate](https://forum.kirupa.com/u/certainfate)
#### Post date: [June 8, 2006, 1:15am UTC](https://forum.kirupa.com/t/loading-xml/190012/1 "2006-06-08T01:15:57Z")

</div>

I have a flash movie that is a scroller and loads xml text/news into the scroller. I have exported the movie and now I load it into an empty mc in another flash movie. It works great when it is alone, but when it is loaded into the empty mc the xml content does not load? what am i missing or doing wrong? Here is the script.

stop();

var filelink = “news.xml”;   
var spacing = 80;

var my\_xml:XML = new XML();  
my\_xml.ignoreWhite = true;  
startheight=0  
contmc.entry.\_visible = false;

var cssStyles:TextField.StyleSheet = new TextField.StyleSheet();

cssStyles.onLoad = function(success) {  
if (success) {  
news.TheText.testtxt.styleSheet = cssStyles  
dates.TheText.testtxt.styleSheet = cssStyles  
}else{  
news.TheText.testtxt.text= “CSS unable to load, contact webmaster.”;  
}  
}

my\_xml.onLoad = function(success:Boolean) {  
if(success) {  
tracknumber = my\_xml.firstChild.childNodes.length;

```
		for (x=0; x&lt;tracknumber; x++) {
			duplicateMovieClip(contmc.entry, "entry"+x, contmc.getNextHighestDepth());
			clipRef = eval("contmc.entry"+x)
			setProperty(clipRef, _y, spacing+startheight);		
			clipRef.titletxt.text = my_xml.firstChild.childNodes[x].childNodes[0].firstChild.nodeValue;
			clipRef.artisttxt.text = my_xml.firstChild.childNodes[x].childNodes[1].firstChild.nodeValue;
			clipRef.desctxt.text = my_xml.firstChild.childNodes[x].childNodes[2].firstChild.nodeValue;
			startheight = clipRef._y + clipRef.desctxt.textHeight;
		}
		nextFrame();
		
    } else {
            trace("Unable to load XML");
    }

```

}

my\_xml.load(filelink);
