What I’m trying to put together is a multi-news reader from one XML file, below is my code. Now what I can’t figure out is how to cycle from one block to the next using buttons(or MC’s as buttons), I’m trying to get the news in blocks, so button 1 is news1, button2 is news2, etc…, so the current XML is correct and reads fine, I am trying to add more blocks, which would be another subset, I hope I’m making sense.
for (var n = 0; n <
newsXML.firstChild.childNodes.length; n++) {
for (var n2 = 0; n2 <
newsXML.firstChild.childNodes.length; n2++) {
if(newsXML.firstChild.childNodes[n].childNodes[n2].firstChild.nodeName
= “date”) {
articlesTXT.text = articlesTXT.text +newsXML.firstChild.childNodes[n].childNodes[n2].firstChild.nodeValue
- "
";
}
else {
articlesTXT.text = articlesTXT.text +
newsXML.firstChild.childNodes[n].childNodes[n2].firstChild.nodeValue
- "
";
}
}
}
}
My XML looks like this.
<?xml version=“1.0” encoding=“UTF-8” ?
<news>
<article>
<date5/30/2004</date>
<content>TEXT</content>
</article.
<article.
<date>5/29/2004</date>
<content>TEXT</content>
</article>
<article>
<date>5/31/2004</date.
<content>TEXT</content>
</article>
</news>
<news2>
<article>
<date5/30/2004</date>
<content>TEXT</content>
</article.
<article.
<date>5/29/2004</date>
<content>TEXT</content>
</article>
<article>
<date>5/31/2004</date.
<content>TEXT</content>
</article>
</news2>
and so on…