/* This is an experimental XML parser wrapper by Ed Mack. It is to save me time Constructor: new xmlQ() eXtensible Markup Language Quick (hehe) Since calling custom events isn't exactly easy, there is a bit of dirty work to be done by the flash script. (ASBroadcaster would require more script, so it wouldn't clean the process up :() Here's an example of using this object: mxmlQ = new xmlQ("config.xml"); mxmlQ.xmlA.onLoad = function(){ info = mxmlQ.parseConfig(); }; And, at the end of it, info is a fully parsed XML document, in this case, a set of strings. There is also a parseMap() method, which will parse an XML document specially formatted as a map */ function xmlQ(src){ this.src = src; // The XML source, ie "myfile.xml" this.loaded = this.load(); // Load me up snotty! } xmlQ.prototype.load = function(){ // The basic loader var loaded; this.xmlA = new XML(); // Load the XML loaded = this.xmlA.load(this.src); // Does the file exist? return loaded; // Tell the caller }; xmlQ.prototype.parseMesh = function(){ var i,j,a; var obj = []; var xmlAc = this.xmlA.firstChild.childNodes; // Get it's children for(i in xmlAc){ // Loop through them var node = xmlAc[i]; // Extract the current child if(node.nodeName != null){ // Filter out whitespace if(node.nodeName == "plane"){ obj.unshift({type:"plane",points:[]}); for(j in node.childNodes){ if(node.childNodes[j].nodeName != null){ a = node.childNodes[j].attributes; obj[0].points.push({x:int(a.x),y:int(a.y),z:int(a.z)}); } } } } } return obj; // Send back the object };