03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - 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.

this.createTextField("my_txt", 1, 100, 100, 300, 100);<br />

my_txt.multiline = true;<br />

my_txt.wordWrap = true;<br />

my_txt.border = true;<br />

my_txt.text = "this is my text"+newline;<br />

my_txt.text += "this is more text"+newline;<br />

my_txt.setTextFormat(my_fmt);<br />

color (TextFormat.color property)<br />

public color : Number<br />

Indicates the color of text. A number containing three 8-bit RGB components; for example,<br />

0xFF0000 is red, <strong>and</strong> 0x00FF00 is green.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 6<br />

Example<br />

The following example creates a text field <strong>and</strong> sets the text color to red.<br />

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

my_fmt.blockIndent = 20;<br />

my_fmt.color = 0xFF0000; // hex value for red<br />

this.createTextField("my_txt", 1, 100, 100, 300, 100);<br />

my_txt.multiline = true;<br />

my_txt.wordWrap = true;<br />

my_txt.border = true;<br />

my_txt.text = "this is my first test field object text";<br />

my_txt.setTextFormat(my_fmt);<br />

font (TextFormat.font property)<br />

public font : String<br />

The name of the font for text in this text format, as a string. The default value is null, which<br />

indicates that the property is undefined.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 6<br />

Example<br />

The following example creates a text field <strong>and</strong> sets the font to Courier.<br />

this.createTextField("mytext",1,100,100,100,100);<br />

mytext.multiline = true;<br />

mytext.wordWrap = true;<br />

mytext.border = true;<br />

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

1254 <strong>ActionScript</strong> classes

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

Saved successfully!

Ooh no, something went wrong!