all groups > flash actionscript > october 2006 >
You're in the

flash actionscript

group:

reading xml


Re: reading xml cinemaguy
10/30/2006 2:24:36 PM
flash actionscript:
firstOption =
infoContent.firstChild.childNodes[0].childNodes[0].nodeValue
secondOption =
infoContent.firstChild.childNodes[1].childNodes[0].nodeValue
reading xml deerowbear
10/30/2006 7:39:46 PM
Hi there,

I am trying to figure out how to parse specific portions of an xml document
into flash. Depending on which frame I am in inside flash a different part of
the xml file will be displayed.

I have an xml file name info.xml with this xml inside of it:
<comName>
<Component1>Although the drunken style moves often appear harmless, they can
be deadly against even the most skilled opponents.</Component1>
<Component2>Monkey style is deceptive and versatile. It is generally meant
for smaller size persons.</Component2>
</comName>

In the actionscript I have this:

myText.html = true;
myText.wordWrap = true;
myText.multiline = true;
myText.label.condenseWhite = true;
//load in XML
infoContent = new XML();
infoContent.ignoreWhite = true;
infoContent.load("info.xml");
infoContent.onLoad = function(success) {
if (success) {
myText.text = infoContent;
}
};

With this code it seems to display both nodes in the xml. I was wondering if
anyone could help me find a way to display just one node.

Thanks dee


AddThis Social Bookmark Button