PDA

View Full Version : very basic XML error.



λ
August 11th, 2003, 05:19 PM
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...

kode
August 11th, 2003, 05:27 PM
myXml.onLoad = function() {
trace(myXml.firstChild.firstChild);
};

lostinbeta
August 11th, 2003, 05:27 PM
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.


kax always beats me :(

kode
August 11th, 2003, 05:29 PM
Yeah... I love you for being so slow. :love:

lostinbeta
August 11th, 2003, 05:37 PM
So you love me for my mental disability :(

kode
August 11th, 2003, 05:41 PM
Nope, I love you because you're smart!! :love:

... Being slow is just a plus. ;)

lostinbeta
August 11th, 2003, 05:43 PM
Originally posted by kax
Nope, I love you because you're smart!! :love:

... Being slow is just a plus. ;)


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


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

don't answer that....


::end transmission::

λ
August 12th, 2003, 08:18 AM
Yeah, I figured it out after a while. Thanks a lot for helping me anyway :)