asdg>> technotes>> how do i display source in an html text field?

Version: Flash MX
Date Added: June 13, 2002

To display HTML source code in an HTML-enabled text field, you must convert the characters <, >, &, ", and ' to their equivalent HTML entity values: &lt;, &gt; &amp; &quot; &apos;. You could write a custom function to do a conversion via search-and-replace, but here's an easier trick: parse the HTML source code as a CDATA section in an XML document. Flash automatically converts the offending characters to their entity values, and you can then access those values with the .toString() method.

Here's some code that shows how it works...