686
ActionScript classes
Example
The following ActionScript creates a text field called
my_txt
and outputs the target path of
the new field, in both slash and dot notation.
this.createTextField("my_txt", this.getNextHighestDepth(), 10, 10, 100,
22);
trace(my_txt._target); // output: /my_txt
trace(eval(my_txt._target)); // output: _level0.my_txt
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 Lite 2.0
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 stringthe HTML-formatted string writes to the log file. When
you trace the value of the
text
property, the unformatted string with HTML tags appears in
the Output panel.When you trace the value of the
text
property, the unformatted string with
HTML tags writes to the log file.
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
htmlText (TextField.htmlText property)
Содержание Flash Lite 2
Страница 1: ...Flash Lite 2 x ActionScript Language Reference...
Страница 22: ...22 Contents...
Страница 244: ...244 ActionScript language elements...
Страница 760: ...760 ActionScript classes...