Xml question

I try to display xml content in a text box with flash5, can display firstchild nodevalue, but firstchild.firstchild.nodevalue gives me always null. The xml file text is something like this:
Please, help, who can help!!! :hair:

[slideshow][slide]flower[/slide][/slideshow]

hm…i’ve never seen an XML file that looked like a sea horse…:wink:

can you attach the file?

only now it is a flower (instead of a horse)

slideshow = xmldata.firstChild;
slide = slideshow.firstChild;
slideval = slide.firstChild.nodeValue; // "flower" is a "child" of slide

anything within the tags is considered a “child”.
also, i hope you’re using angle brackets and not those square brackets.

yes, it looks similar to yours, but does not work:
my_xml = new XML();
my_xml.onLoad = function () { mytext = my_xml.firstchild.firstchild.nodename;};
my_xml.load(“myxmlfile.xml”);

Oh, stupid me, see my mistake.
Thank you a lot
now will try the variant you gave me!!!

when you do an onLoad with XML you have to pass a success parameter:

my_xml = new XML();
my_xml.onLoad = function (success) {
if (success) {
mytext = this.firstChild.firstChild.firstChild.nodeValue;
}
};
my_xml.load("myxmlfile.xml");

Also, within functions, you have to use “this” to refer to its own objects.

nice try. Just copied and pasted yours, does not work.
thank you anyway.

hm…still doesn’t work?

i’m more familiar with MX’s XML code, so what I have there may be different from 5’s XML.