stop();
//create a XML object
var XMLTree:XML = new XML();
// set it to ignore white spaces
XMLTree.ignoreWhite = true;
// set a handler for the onLoad event
XMLTree.onLoad = function(s) {
delete preloader_mc.onEnterFrame;
if (!s) {
// if an error occurs
trace("error");
return;
}
// go to the next frame
play();
};
if (xml == undefined) {
xml = "data.xml";
}
// preload current movie
_root.onEnterFrame = function() {
if (this.getBytesLoaded() == this.getBytesTotal()) {
delete this.onEnterFrame;
// after the movie has loaded, load the xml file
XMLTree.load(xml);
}
};
The XML is:
|