03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

var my_fmt:TextForma( = new TextFormat();<br />

my_fmt.bold = true;<br />

my_fmt.font = "Arial";<br />

my_fmt.color = 0xFF9900;<br />

this.createTextField("my_txt", 999, 0, 0, 400, 300);<br />

my_txt.wordWrap = true;<br />

my_txt.multiline = true;<br />

my_txt.border = true;<br />

my_txt.type = "input";<br />

my_txt.setNewTextFormat(my_fmt);<br />

my_txt.text = "Oranges are a good source of vitamin C";<br />

See also<br />

getNewTextFormat (TextField.getNewTextFormat method), getTextFormat<br />

(TextField.getTextFormat method), setTextFormat (TextField.setTextFormat<br />

method)<br />

setTextFormat (TextField.setTextFormat method)<br />

public setTextFormat([beginIndex:Number], [endIndex:Number],<br />

textFormat:TextFormat) : Void<br />

Applies the text formatting specified by the textFormat parameter to some or all of the text<br />

in a text field. textFormat must be a TextFormat object that specifies the text formatting<br />

changes desired. Only the non-null properties of textFormat are applied to the text field. Any<br />

property of textFormat that is set to null will not be applied. By default, all of the properties<br />

of a newly created TextFormat object are set to null.<br />

There are two types of formatting information in a TextFormat object: character level, <strong>and</strong><br />

paragraph level formatting. Each character in a text field might have its own character<br />

formatting settings, such as font name, font size, bold, <strong>and</strong> italic.<br />

For paragraphs, the first character of the paragraph is examined for the paragraph formatting<br />

settings for the entire paragraph. Examples of paragraph formatting settings are left margin,<br />

right margin, <strong>and</strong> indentation.<br />

The setTextFormat() method changes the text formatting applied to an individual<br />

character, to a range of characters, or to the entire body of text in a text field:<br />

■ Usage 1:my_textField.setTextFormat(textFormat:TextFormat)<br />

Applies the properties of textFormat to all text in the text field.<br />

■ Usage 2:my_textField.setTextFormat(beginIndex:Number,<br />

textFormat:TextFormat)<br />

Applies the properties of textFormat to the character at the beginIndex position.<br />

TextField 641

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!