Textfield.setnewtextformat() - MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference

Actionscript language reference
Table of Contents

Advertisement

TextField.setNewTextFormat()

Availability
Flash Player 6.
Usage
my_txt.setNewTextFormat(textFormat:TextFormat) : Void
Parameters
A TextFormat object.
textFormat
Returns
Nothing.
Description
Method; sets the default new text format of a text field; that is, the text format to be used for
newly inserted text, such as text inserted with the
user. When text is inserted, the newly inserted text is assigned the default new text format.
The new default text format is specified by
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";
See also
TextField.getNewTextFormat(), TextField.getTextFormat(),
TextField.setTextFormat()
replaceSel()
, which is a TextFormat object.
textFormat
) is created at runtime and several
my_txt
TextField.setNewTextFormat()
method or text entered by a
917

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx

Table of Contents