Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 1.0 (and below)

Reply
 
Thread Tools Rate Thread Display Modes
Old 02-10-2004, 09:33 AM   #1
landav
Registered User
 
Join Date: Feb 2004
Posts: 5
Default 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!");
}
landav is offline   Reply With Quote
Old 02-10-2004, 12:58 PM   #2
Timmee_3Styler
Canadian Flasher
 
Join Date: May 2002
Location: T dot O dot
Posts: 1,648
Default

trace(XMLData_xml.childnodes[0].nodeName);


this line gives you undefined?
Timmee_3Styler is offline   Reply With Quote
Old 02-10-2004, 02:43 PM   #3
landav
Registered User
 
Join Date: Feb 2004
Posts: 5
Default

Yes, I get undefined for this line.

trace(XMLData_xml.childnodes[0].nodeName);
landav is offline   Reply With Quote
Old 02-10-2004, 04:31 PM   #4
Timmee_3Styler
Canadian Flasher
 
Join Date: May 2002
Location: T dot O dot
Posts: 1,648
Default

Im new to xml as well but can i take a look @ ur xml file aswell?
Timmee_3Styler is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:22 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.