
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
1000
|
Appendix E: HTML Support in Text Fields
we must assign HTML text to a TextField object’s htmlText property or, in Flash 5, to
the variable associated with the text field. For example:
// Flash 6 syntax
theField_txt.htmlText = "<P><B>Error!</B> <I>No email address!</I></P>";
// Flash 5 syntax
theField_txt = "<P><B>Error!</B> <I>No email address!</I></P>";
In Flash 6, the Flash 5 syntax will not only fail to work, it will replace
the TextField object with the assigned string! In Flash 6, use of the
htmlText property is mandatory.
In the Flash Player, HTML can also be entered into a movie via an HTML-enabled or
regular (non-HTML) user-input text field.
When regular text is entered into an HTML-enabled user-input text field, the field’s
htmlText property includes markup tags that are added automatically. For example,
the input text “Hi there” is converted to the
htmlText property value:
'<P ALIGN="LEFT"><FONT FACE="Arial" SIZE="10" COLOR="#000000">Hi there</FONT></P>'
When the HTML characters <, >, &, ", and ' are entered into an HTML-enabled user-
input text field, the field’s
htmlText property represents them with the entities >,
<, &, ", and '. For example, the input text “<B>hi there</B>”is
converted to the
htmlText property value:
'<P ALIGN="LEFT"><FONT FACE="Arial" ...