TextField
1207
this.createTextField("date_txt", this.getNextHighestDepth(), 10, 10, 100,
22);
date_txt.autoSize = true;
date_txt.selectable = true;
var date_interval:Number = setInterval(updateTime, 500, date_txt);
function updateTime(my_txt:TextField) {
my_txt.text = new Date().toString();
}
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.
setNewTextFormat (TextField.setNewTextFormat
method)
public setNewTextFormat(tf:TextFormat) : Void
Sets the default new text format of a text field. The default new text format is the new text
format used for newly inserted text such as text inserted with the
replaceSel()
method or
text entered by a user. When text is inserted, the newly inserted text is assigned the default
new text format.
The new default text format is specified by
textFormat
, which is a TextFormat object.
Availability:
ActionScript 1.0; Flash Player 6
Parameters
tf
:TextFormat
- A TextFormat object.
Example
In the following example, a new text field (called
my_txt
) is created at runtime and several
properties are set. The format of the newly inserted text is applied.
var my_fmt:TextFormat = new TextFormat();
my_fmt.bold = true;
my_fmt.font = "Arial";
my_fmt.color = 0xFF9900;
this.createTextField("my_txt", 999, 0, 0, 400, 300);
my_txt.wordWrap = true;
my_txt.multiline = true;
my_txt.border = true;
my_txt.type = "input";
my_txt.setNewTextFormat(my_fmt);
my_txt.text = "Oranges are a good source of vitamin C";
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...