HTML in XML for Flash ActionScript 2
Here is the solution of inserting HTML formatted text into your Flash files through XML:
In your XML add your HTML data like this:
<htmlData><![CDATA[ Here is my <br/> html text ]]></htmlData>
As a note, you can't insert your HTML data into an XML attribute.
In your Flash file do something similar to this:
xml = new XML();
xml.ignoreWhite = true;
xml.load("myXMLfile.xml");
xml.onLoad = function () {
txt = createTextField("txt", 0, 0, 0, 0, 0);
txt.html = true;
txt.htmlText = xml.firstChild.nodeValue;
}



Leave a Reply