Hey everyone,
I feel a little silly for posting this because it seems like an easy answer and I’m probably overlooking a careless mistake.
But I’m trying to push some XML values into an array by looping through them and then trace them out to see the answer and it’s not working.
The
Here’s my code:
for (var i:Number = 0; i < node.firstChild.childNodes.length; i++) {
myNode* = node.childNodes[0].childNodes*.childNodes[0];
trace("myNode[" + i + "] is " + myNode*);
trace("raw data: " + node.childNodes[0].childNodes*.childNodes[0]);
};
My XML:
<?xml version "1.0" encoding="UTF-8" ?>
<XMLTest>
<test name="Listing 1">Choice1, Choice2, Choice3</test>
<test name="Listing 2">Choice1, Choice2</test>
</XMLTest>
And here’s the trace statement:
myNode[0] is undefined
raw data: Choice1, Choice2, Choice3
myNode[1] is undefined
raw data: Choice1, Choice2
Thanks for any help you can provide!