[FMX] preloading + xml problem

Ok, basically i have a scene with 2 frames, one is the loader and the other one the animation.

In the first one i am loading xml from a php file, which works perfectly. Now i have a preloder that also works perfectly for the animation, but now what id like to do is prevent the animation from starting before the function i call after loading my xml to parse it is completed.

heres what i have in frame one:

startup_xml = new XML();
startup_xml.ignoreWhite = true;

startup_xml.onLoad = loadStartupXML;
_root.startup_xml.load("xml_gen.php?action=startup");

// Used in the loading progress bar to complete only if the data has been treated completely
// by the loadStartupXml function
bool_xmlLoaded = false;

this.onEnterFrame = function () {
	bytes_loaded_movie = Math.round(this.getBytesLoaded());
	bytes_total_movie = Math.round(this.getBytesTotal());
	bytes_loaded_xml = Math.round(startup_xml.getBytesLoaded());
	bytes_total_xml = Math.round(startup_xml.getBytesTotal());
	bytes_loaded = bytes_loaded_movie + bytes_loaded_xml;
	bytes_total = bytes_total_movie + bytes_total_xml;

	// Display
	getPercent = bytes_loaded/bytes_total;
	this.loader.bar_fill._xscale = getPercent*100;
	
	_root.trace.text=(bytes_loaded == bytes_total) && bool_xmlLoaded;
	
	if (bytes_loaded == bytes_total) {
		this.gotoAndStop(2);
	}
}

///////////////////////////////////////////////////////////////////////////
// Loads and parse the generated XML file for the current category
///////////////////////////////////////////////////////////////////////////
function loadStartupXML(loaded) {
  if (loaded) {
		xmlNode = this.firstChild;
				
		// Loads the contact info info
		contact.name = xmlNode.childNodes[0].childNodes[0].childNodes[0].nodeValue;
		contact.street = xmlNode.childNodes[0].childNodes[1].childNodes[0].nodeValue;
		contact.city = xmlNode.childNodes[0].childNodes[2].childNodes[0].nodeValue;
		contact.province = xmlNode.childNodes[0].childNodes[3].childNodes[0].nodeValue;
		contact.zip = xmlNode.childNodes[0].childNodes[4].childNodes[0].nodeValue;
		contact.country = xmlNode.childNodes[0].childNodes[5].childNodes[0].nodeValue;
		contact.phone1 = xmlNode.childNodes[0].childNodes[6].childNodes[0].nodeValue;
		contact.phone2 = xmlNode.childNodes[0].childNodes[7].childNodes[0].nodeValue;
		contact.fax = xmlNode.childNodes[0].childNodes[8].childNodes[0].nodeValue;
		contact.email = xmlNode.childNodes[0].childNodes[9].childNodes[0].nodeValue;

		bool_xmlLoaded = true;
	}
}
///////////////////////////////////////////////////////////////////////////

At first i thought to change the if in the onEnterFrame by

if ((bytes_loaded == bytes_total) && bool_xmlLoaded) {
	this.gotoAndStop(2);
}

(which is the reason for the xmlLoaded variable, but it simply doesnt work, instead of stoping at the second frame after loading, it flashes non stop. Another thing that makes it flash is when i put the gotoandstop(2) in comments (could someone explain that to me???)

So, any help would be greatly appreciated.