How to Preload the XML file?

Hello everybody! [/dr.nick] :stuck_out_tongue:

I have a Flash movie, and just made myself a preloader from the tutorial on this site.

onClipEvent (enterFrame) {
	var bytes = _root.getBytesTotal();
	var bytes_loaded = _root.getBytesLoaded();
	if (bytes_loaded == bytes) {
		this.mytxt = "movie loaded";
	} else {
		this.mytxt = "loading (" + bytes_loaded + "/" + bytes +")";

It loads and works great! But here’s the problem … I’m also using an XML file to generate the text in my movie. Can I combine the actionscript above to include loading my XML file, or what is the proper way to do that? Here is the code I’m using for the XML…

var mxml = new XML();
mxml.ignoreWhite = true;
mxml.onLoad = function(success) {
	if (success) {
		title1 = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
		text1 = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;
		title2 = this.firstChild.childNodes[1].childNodes[0].firstChild.nodeValue;
		text2 = this.firstChild.childNodes[1].childNodes[1].firstChild.nodeValue;
		var5 = "i am being called from var5";
title_txt.text = title1;
body_txt.text = text1;

Any help would be greatly appreciated :slight_smile: