User Guide
926 Chapter 2: ActionScript Language Reference
TextField.text
Availability
Flash Player 6.
Usage
my_txt.text:String
Description
Property; indicates the current text in the text field. Lines are separated by the carriage return
character ('\r', ASCII 13). This property contains the normal, unformatted text in the text field,
without HTML tags, even if the text field is HTML.
Example
The following example creates an HTML text field called my_txt, and assigns an HTML-
formatted string of text to the field. When you trace the
htmlText property, the Output panel
displays the HTML-formatted string. When you trace the value of the
text property, the
unformatted string with HTML tags displays in the Output panel.
this.createTextField("my_txt", this.getNextHighestDepth(), 10, 10, 400, 22);
my_txt.html = true;
my_txt.htmlText = "<b>Remember to always update the help panel.</b>";
trace("htmlText: "+my_txt.htmlText);
trace("text: "+my_txt.text);
/* output:
htmlText: <P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12"
COLOR="#000000"><B>Remember to always update your help panel.</B></FONT></P>
text: Remember to always update your help panel.
*/
See also
TextField.htmlText