Xml problem

hi there,

i was wondering if anyone knew why i was having the problem i am having with xml being displayed in flash mx. the tutorial on this site works fine, but when i write my own xml file and modify the as, i encounter the problems. ideally, i wolud like to be able to load text files and urls of images to be loaded into flash, and i pretty much know how to do all of this. flash recognises the xml file fine and actually loads it, however, when i try to use the nodeValue action, i am always given the value “null.” this is because flash thinks the node is an element rather than a text node (type 1 rather than 3, when you use nodeType.) i don’t know why it does this when it is obviously a text node. any ideas?


any help appreciated, and i really need it. it’s ncredibly frustrating when you have set out some of the xml files the way you want, flash loads up the files fine and then says that the elements are the wrong kind to read the value of. i really have no idea.

it even happens when i use the tutorial given file and just modify it by adding a node. i really really don’t understand.

hope this helps you:
if your xml looks like something like this:
<node s=“this” />
<node s="!!!">this is the node value</node>

you will read it like this:
(myXML is the entire xml)
myXML.firstChild = (all the relevant xml)
myXML.firstChild.childNodes = (an array contaning 2 nodes)
myXML.firstChild.childNodes[0] = <node s=“this” /> (first Node)
myXML.firstChild.childNodes[1] = <node s="!!!">this is the node value</node>
then, to get the nodeValue you have to remember that the node value is like another node; is a text node:
myXML.firstChild.childNodes[1].firstChild.nodeValue = this is the node value

thank you so much, i guessed it would be something very simple that i had just overlooked. as are most of my problems in flash.