Hey all,
I am having some troubles with my XML. What seems to be the problem to me is that when I try to get the a childNode using a like and referencing an idex, its getting that childNodes children and so on. Or so I think. I’m likely wrong though since I still can’t figure it out.
Anyways, here’s the AS:
var container_xml:XML = new XML();
container_xml.onLoad = startXML;
container_xml.load("container_xml.xml");
container_xml.ignoreWhite = true;
function startXML(success){
if (success == true){
rootNode = container_xml.firstChild
}
}
........
xmlLength = rootNode.childNodes;
for(i=0;i<xmlLength.length; i++){
currentNode = xmlLength*;
xmlLength = rootNode.currentNode.childNodes;
for(ii=0;ii<xmlLength.length; ii++){
firstKid = xmlLength.firstChild;
heightOffSet = parseInt(firstKid.firstChild);
centerOffSet = parseInt(firstKid.nextSibling.firstChild);
}
}
just a note I have removed the second for loop since I didn’t think it was doing anything useful.
And the XML:
<root>
<container a="container">
<h>10</h>
<o>0</o>
</container>
</root>
That isn’t my entire AS, but just the XML parts. The rest can be posted if someone think it will help.
Thanks in advance