Hi All,
I have this dynamic menu that loads data from a xml file and loads a coprresponding movie. BUT, is it possible to set a variable as well OR instead so before the new movie gets laoded I can play something like a outro mc, check variables and then load the new mc??
Here`s the code:
Thanks in advance,
m.
var XMLfile = 'menu.xml'; // the xml file to parse
importXML = new XML();
importXML.varTarget = this; // location to tranfer data
importXML.ignoreWhite = true; // remove whitespace from the xml document
importXML.onLoad = function(success){
if(success){
// pointer to data tranfer location
var vt = this.varTarget;
// pointer to root node
var root = this.firstChild;
// --------------------------------------------------
vt.menuObj = new Object();
var i, j, k, m;
for(i = root.lastChild, j = 1; i != null; i = i.previousSibling, j++){
vt.menuObj['item'+j] = new Object();
vt.menuObj['item'+j].name = i.attributes.name;
vt.menuObj['item'+j].arg = (typeof(i.attributes.arg) == 'undefined') ? null : i.attributes.arg ;
vt.menuObj['item'+j].sub = false;
if(i.hasChildNodes()){
vt.menuObj['item'+j].sub = true;
for(k = i.lastChild, m = 1; k != null; k = k.previousSibling, m++){
vt.menuObj['item'+j]['sub'+m] = new Object();
vt.menuObj['item'+j]['sub'+m].name = k.attributes.name;
vt.menuObj['item'+j]['sub'+m].arg = k.attributes.arg;
}
}
}
vt.play(); // data conversion complete
// --------------------------------------------------
}else{
trace('ERROR PARSING XML');
}
}
importXML.load(XMLfile);