
TextField.htmlText Property
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Alphabetical Language Reference
|
845
TextField.htmlText Property
HTML source code to render in the text field
Flash 6
read/write
theField.htmlText
Description
Like the text property, htmlText is used to specify text for on-screen display but with the
added feature that if the
html property is true, HTML tags in htmlText are interpreted as
formatting instructions. To display formatted HTML in a text field, first set
html to true,
and then assign HTML source code to
htmlText:
this.createTextField("theField_txt", 1, 0, 0, 200, 20);
theField_txt.html = true;
theField_txt.htmlText = '<B>This will display bold text.</B>';
The set of supported tags is limited, compared to a web browser, but it still provides good
basic text control. See Appendix E for details.
Assigning a value to htmlText overwrites the value of text, and vice
versa. In most cases, if you are using HTML text, set the
html prop-
erty to
true and access the field’s text using the htmlText property. If
you are using non-HTML text, set the
html property to false and
access the field’s text using the
text property.
When html is false, HTML tags in text assigned to htmlText show up as regular text, and
htmlText behaves in the same way as the text property. HTML tags assigned directly to
text are never interpreted as ...