Hey all -
Trying to get a text field in my Flash MX movie to pull from and XML file with CDATA tags to show as HTML. I’ve checked the box to render as HTML for the text data field… but I’m having problems with the Actionscripting.
The field from this line is what I need to recognize as HTML reading CDATA tags:
this.ref[“textField”+i].text = subnodes[3].firstChild.toString()
I know I need to do more than just change it to “.html” instead of “.text” and have tried a couple things, but nothing seems to work.
Any help greatly appreciated!
//Create the XML Object
myXML = new XML ();
myXML.load(newXml);
myXML.ignoreWhite = true;
//Load XML file
myXML.load("PBintro.xml");
//Make a reference to current timeline
myXML.ref = this
// Parse XML and fetch
myXML.onLoad = function(success){
if(success){
var root = this.firstChild ;
nodes = root.childNodes
for(var i=0; i<nodes.length; i++) {
this.ref["Title_txt"+i].text = nodes*.attributes.name
subnodes = nodes*.childNodes
this.ref["Comments_txt"+i].text = subnodes[0].firstChild.toString()
this.ref["Link_txt"+i].text = subnodes[0].firstChild.toString()
this.ref["Link_txt"+i] = subnodes[1].firstChild.toString()
this.ref["holder_mc"+i].loadMovie(subnodes[2].firstChild.toString())
this.ref["textField"+i].text = subnodes[3].firstChild.toString()
this.ref["textField"+i] = subnodes[4].firstChild.toString()
}
} else trace("Error loading XML document")
}