Very basic XML error

I’m trying to get XML to work in Flash, and I just can’t make it work :-\

I tried making something more advanced, but it just failed miserably, so for now I’m settling for something simpler.


myXml = new XML();
myXml.load("myxml.xml");
myXml.ignoreWhite = true;
myXml.onLoad = function() {
	trace(myXml.firstChild.nodeValue);
};


<myxml>Hello</myxml>

I just see null in the output window…

[AS]myXml.onLoad = function() {
trace(myXml.firstChild.firstChild);
};[/AS]

  1. Your XML file cannot just be 1 node, it has to have a parent node that houses the childnodes…
<parentnode>
<myxml>Hello</myxml>
</parentnode>

Then after you fix that change myXml.firstChild.nodeValue to myXml.firstChild.firstChild

You can read up on what nodeValue really is in the AS Reference in Flash MX.

[edit]kax always beats me :([/edit]

Yeah… I love you for being so slow. :love:

So you love me for my mental disability :frowning:

Nope, I love you because you’re smart!! :love:

… Being slow is just a plus. :wink:

*Originally posted by kax *
**Nope, I love you because you’re smart!! :love:

… Being slow is just a plus. :wink: **

LOL, that’s a load of crap :sleep:

Hey kax, why do we always end up thread hijacking?

[size=1]don’t answer that…[/size]

[size=1]::end transmission::[/size]

Yeah, I figured it out after a while. Thanks a lot for helping me anyway :slight_smile: