Setnewtextformat (Textfield.setnewtextformat Method) - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

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()
7 or later. If your SWF file includes a version 2 component, use the version 2 components
DepthManager class instead of the
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
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
Availability: ActionScript 1.0; Flash Player 6
Parameters
- A TextFormat object.
tf:TextFormat
Example
In the following example, a new text field (called
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";
method used in this example requires Flash Player
MovieClip.getNextHighestDepth()
, which is a TextFormat object.
textFormat
my_txt
method.
replaceSel()
) is created at runtime and several
method or
TextField
1207

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents