ActionScript for Flash MX: The Definitive Guide, 2nd Edition By Colin Moock
Appendix E. HTML Support in Text Fields
In most JavaScript-capable web browsers, it is possible to execute JavaScript statements from an anchor tag using the javascript: protocol as the value of the HREF attribute. For example:
<A HREF="javascript:square(5);">find the square of 5</A>
In ActionScript, we can also execute JavaScript statements from an <A> tag, like this:
theField_txt.htmlText = "<A HREF='javascript:alert(5);'>display the number 5</A>";
However, to include string values in JavaScript statements, we must use the HTML entity " for quotation marks, as in: