I am loading an XML file into a dynamic textfield in flash.
Is it possible to load in HTML text from the XML file… If so how??
my XML file looks like this
<?xml version="1.0" encoding="iso-8859-1"?>
<news>
<entry
date="10th Feb, 2004"
description="First Version of site. Still Working Refining."
/>
<entry
date="10th Feb, 2004"
description="check out <a href='http://www.xotyx.com/'> Xotyx.com</a>"
/>
</news>
Flash reads in the XML but doesnt display the second entry… So the code is not right… Here is the AS…
[AS]
// reading in XML…
var news = new XML();
news.ignoreWhite = true;
var entry = 0;
var total = 0;
var current = 0;
news.load(“news.xml”);
news.onLoad = function(success) {
_root.total = this.firstChild.childNodes.length;
if (success) {
_root.entry = _root.total - 1;
for (i=_root.total; i > 0; i–)
{
date_txt = this.firstChild.childNodes[_root.entry].attributes.date;
description_txt = this.firstChild.childNodes[_root.entry].attributes.description;
scrollerTxt = scrollerTxt + date_txt + "
" + description_txt + "
";
_root.entry–;
}
//newTxt is the instance name of they dynmic textfield.
newsTxt.htmlText = scrollerTxt;
}
};
[/AS]