EasyManua.ls Logo

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE - Setnewtextformat (Textfield.setnewtextformat Method)

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE
780 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
678 ActionScript classes
Note: This property is not supported for Arabic, Hebrew, and Thai.
Availability: ActionScript 1.0; Flash Lite 2.0
Example
The following example creates a selectable text field that constantly updates with the current
date and time.
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();
}
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 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 Lite 2.0
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;

Table of Contents

Related product manuals