stop(); // STAGE SET Stage.align = "TL"; Stage.scaleMode = "noScale"; Stage.showMenu = false; // Global Root _global.gRoot; // FLASHVARS if (xml == undefined) { xml = "data.xml"; } // JS ALERT function jsAlert(s:String) { getURL("javascript:alert("+s+");"); } // ROOT PRELOAD function preloadRoot() { _root.onEnterFrame = function() { if (_root.getBytesLoaded() == _root.getBytesTotal()) { delete this.onEnterFrame; play(); } }; } // XML LOAD var xmlOb:XML = new XML(); xmlOb.ignoreWhite = true; xmlOb.onLoad = function(b:Boolean) { if (!b) { trace("Unable to load/parse XML !"); jsAlert("Unable to load/parse XML !"); } else { var msg:String = new String(); switch (this.status) { case 0 : _global.gRoot = this.firstChild; preloadRoot(); break; case -2 : msg = "A CDATA section was not properly terminated."; break; case -3 : msg = "The XML declaration was not properly terminated."; break; case -4 : msg = "The DOCTYPE declaration was not properly terminated."; break; case -5 : msg = "A comment was not properly terminated."; break; case -6 : msg = "An XML element was malformed."; break; case -7 : msg = "Out of memory."; break; case -8 : msg = "An attribute value was not properly terminated."; break; case -9 : msg = "A start-tag was not matched with an end-tag."; break; case -10 : msg = "An end-tag was encountered without a matching start-tag."; break; default : msg = "An unknown error has occurred."; break; } msg = "Unable to parse XML. "+msg; msg += " Can't continue."; if (xml.status) { trace(msg); jsAlert(msg); } } }; xmlOb.load(xml);