ndee
08-11-2005, 01:17 AM
Call me a newbie, call me an amateur, and you'll be propably right, but that still won't solve this question:
I'm building this piece of script which reads out an XML file. All the nodes are run through with a for loop. The idea is that everytime the index of the for loop finds a new node, the contents of the node are placed into an array. This gives me the following code. Note that this is just a part of the total script.. obviously..
content = new Array();
for (var n = 0; n<xmlDoc_xml.firstChild.childNodes.length; n++) {
inhoud = xmlDoc_xml.firstChild.childNodes[n].firstChild.firstChild.nodeValue;
content[n] = inhoud;
trace(inhoud);
}
trace(content);
trace(content[1]);
The diagnostics:
* 'inhoud' works fine, it contains the same content as the node.
* Either content, as content[1] seems to be empty. trace(content); results in void, and trace(content[1]); results in undefined.
So obviously i'm doing something wrong here with defining the array, but it's 4.15 AM local time.. i'm tired and i ran over this script way to often to recorgnize any errors anymore.. I've run through the tutorials on actionscript.org and others, run F1 and kicked Google to look for me, but no results there either. So please, is there anybody who can figure out why this isn't working?
Many thanks in advance,
nd
I'm building this piece of script which reads out an XML file. All the nodes are run through with a for loop. The idea is that everytime the index of the for loop finds a new node, the contents of the node are placed into an array. This gives me the following code. Note that this is just a part of the total script.. obviously..
content = new Array();
for (var n = 0; n<xmlDoc_xml.firstChild.childNodes.length; n++) {
inhoud = xmlDoc_xml.firstChild.childNodes[n].firstChild.firstChild.nodeValue;
content[n] = inhoud;
trace(inhoud);
}
trace(content);
trace(content[1]);
The diagnostics:
* 'inhoud' works fine, it contains the same content as the node.
* Either content, as content[1] seems to be empty. trace(content); results in void, and trace(content[1]); results in undefined.
So obviously i'm doing something wrong here with defining the array, but it's 4.15 AM local time.. i'm tired and i ran over this script way to often to recorgnize any errors anymore.. I've run through the tutorials on actionscript.org and others, run F1 and kicked Google to look for me, but no results there either. So please, is there anybody who can figure out why this isn't working?
Many thanks in advance,
nd