TextField
1217
text (TextField.text property)
public text : String
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.
Availability:
ActionScript 1.0; Flash Player 6
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>Lorem ipsum dolor sit amet.</B>";
trace("htmlText: "+my_txt.htmlText);
trace("text: "+my_txt.text);
This generates the following output:
htmlText: <P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12"
COLOR="#000000" KERNING="0">
<B>Lorem ipsum dolor sit amet.</B></FONT></P>
text: Lorem ipsum dolor sit amet.
The
MovieClip.getNextHighestDepth()
method used in this example requires Flash Player
7 or later. If your SWF file includes a version 2 component, use the version 2 components
DepthManager class instead of the
MovieClip.getNextHighestDepth()
method.
See also
htmlText (TextField.htmlText property)
textColor (TextField.textColor property)
public textColor : Number
Indicates the color of the text in a text field. The hexadecimal color system uses six digits to
represent color values. Each digit has sixteen possible values or characters. The characters
range from 0 to 9 and then A to F. Black is represented by (
#000000
) and white, at the
opposite end of the color system, is (
#FFFFFF
).
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...