A simple as2 flash app that is reading an XML file.
There is Flash AS2:
function loadXML (load) {if (loaded) {_root.inventor = this.firstChild.childNodes [0] .childNodes [0 ] .firstChild.nodeValue; _root.comments = this.firstChild.childNodes [0]. ChildNode [1] FirstChild.nodeValue; Name_txt.text = _root.inventor; Comment_txt.text = _root.comments; } And {content = "File not loaded!"; }} XmlData = New XML (); XmlData.ignoreWhite = True; XmlData.onLoad = loadXML; XmlData.load ("inventors.xml");
And here is my XML:
The problem is that the Flash dynamic text box will not read XML (HTML) as HTML - hence the & lt; B & gt; I'm bold & lt; / B & gt; I'm not in the flash as the
tag ?? Am i missing ?? Thank you.
I got it !!! And it works!
In Flash I need to change the variables to recognize HTML:
Similar:
name_txt.htmlText = _root Inventor; Comment_txt.htmlText = _root.comments;
Then in my XML file, I need to use CDATA, such as:
Comments
Post a Comment