Help! Problem reading xml childnodes
In the code below everthing works great except that when I do the trace to see the child node data it comes up undefined. I'm a newbie to this and have been messing with it for hours and I don't understand why it doesn't work.
Thanks in Advance.
Landav
onClipEvent (load) {
myLoadVars_lv = new LoadVars();
myLoadVars_lv.load("zipcode.txt");
myLoadVars_lv.onLoad = function(success) {
if (success) {
// store path in var
var urlZipcode = this.zip; // theXMLPath is the var in path.txt file
// xml
XMLData_xml = new XML();
XMLData_xml.ignoreWhite = true;
XMLData_xml.load("http://www.weatherroom.com/xml/ext/" + urlZipcode);
XMLData_xml.onLoad = function(success) {
if (success) {
if (XMLData_xml.status == 0) {
trace("XML object: " + XMLData_xml);
trace(XMLData_xml.childnodes[0].nodeName);
}else trace("Parse Error: "+XMLData_xml.status);
}
else trace("problem loading XML!");
}
}
else trace("problem loading textFile!");
}
|