Settextformat (Textfield.settextformat Method) - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

my_txt.type = "input";
my_txt.setNewTextFormat(my_fmt);
my_txt.text = "Oranges are a good source of vitamin C";
See also
getNewTextFormat (TextField.getNewTextFormat method)
(TextField.getTextFormat method)
method)

setTextFormat (TextField.setTextFormat method)

public setTextFormat([beginIndex:Number], [endIndex:Number],
textFormat:TextFormat) : Void
Applies the text formatting specified by the
in a text field.
textFormat
changes desired. Only the non-null properties of textFormat are applied to the text field. Any
property of
textFormat
of a newly created TextFormat object are set to
There are two types of formatting information in a TextFormat object: character level, and
paragraph level formatting. Each character in a text field might have its own character
formatting settings, such as font name, font size, bold, and italic.
For paragraphs, the first character of the paragraph is examined for the paragraph formatting
settings for the entire paragraph. Examples of paragraph formatting settings are left margin,
right margin, and indentation.
The
setTextFormat()
character, to a range of characters, or to the entire body of text in a text field:
Usage 1:
my_textField.setTextFormat(textFormat:TextFormat)
Applies the properties of
Usage 2:
my_textField.setTextFormat(beginIndex:Number,
textFormat:TextFormat)
Applies the properties of
Usage 3:
my_textField.setTextFormat(beginIndex:Number, endIndex:Number,
textFormat:TextFormat)
Applies the properties of the
position to the
beginIndex
Notice that any text inserted manually by the user receives the text field's default formatting
for new text, and not the formatting specified for the text insertion point. To set a text field's
default formatting for new text, use
,
setTextFormat (TextField.setTextFormat
textFormat
must be a TextFormat object that specifies the text formatting
that is set to null will not be applied. By default, all of the properties
method changes the text formatting applied to an individual
to all text in the text field.
textFormat
to the character at the
textFormat
textFormat
position.
endIndex
TextField.setNewTextFormat()
,
getTextFormat
parameter to some or all of the text
.
null
beginIndex
parameter to the span of text from the
position.
.
TextField
679

Advertisement

Table of Contents
loading

Table of Contents