home *** CD-ROM | disk | FTP | other *** search
- class CConfigLoader
- {
- var myXML;
- var cbfunc;
- function CConfigLoader(sConfigFile, cbFunc)
- {
- this.myXML = new CXML();
- this.myXML.cbfunc = mx.utils.Delegate.create(this,this.onXMLLoad);
- this.myXML.load(sConfigFile != undefined ? sConfigFile : "config.xml");
- this.cbfunc = cbFunc;
- }
- function parse()
- {
- for(var i in this.myXML.oResult.config["static"])
- {
- for(var j in this.myXML.oResult.config["static"][i])
- {
- var parent = eval(i);
- parent[j] = this.myXML.oResult.config["static"][i][j];
- }
- }
- }
- function onXMLLoad(bSuccess)
- {
- if(bSuccess)
- {
- this.parse();
- }
- this.cbfunc(bSuccess);
- }
- }
-