I’m running into some problems when parsing an XML file. In the first frame of my SWF I define the following “constant”:
[AS]this.addProperty(“XML_CAMINHO_DADOS”, function(){return “xml.firstChild.childNodes[1]”}, null);[/AS]
I then try calling it later on like this (after I load in my XML and all):
[AS]var caminhoDados:XMLNode = eval(XML_CAMINHO_DADOS);
trace(caminhoDados.nodeName);[/AS]
I was suspecting that this would basically call xml.firstChild.childNodes[1].nodeName but instead it returns undefnied.
The strange thing is, it works if I don’t use childNodes in the path, like this:
this.addProperty("XML_CAMINHO_DADOS", function(){return "xml.firstChild.firstChild.nextSibling"}, null);
Any reason as to why using childNodes prevents me from doing what I’m trying to do?
Cheers!