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.

Example<br />

The following example creates two text fields, one with tab stops every 40 pixels, <strong>and</strong> the<br />

other with tab stops every 75 pixels.<br />

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

mytext.border = true;<br />

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

myformat.tabStops = [40,80,120,160];<br />

mytext.text = "A\tB\tC\tD"; // \t is the tab stop character<br />

mytext.setTextFormat(myformat);<br />

this.createTextField("mytext2",2,100,220,400,100);<br />

mytext2.border = true;<br />

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

myformat2.tabStops = [75,150,225,300];<br />

mytext2.text ="A\tB\tC\tD";<br />

mytext2.setTextFormat(myformat2);<br />

target (TextFormat.target property)<br />

public target : String<br />

Indicates the target window where the hyperlink is displayed. If the target window is an empty<br />

string, the text is displayed in the default target window _self. You can choose a custom<br />

name or one of the following four names: _self specifies the current frame in the current<br />

window, _blank specifies a new window, _parent specifies the parent of the current frame,<br />

<strong>and</strong> _top specifies the top-level frame in the current window. If the TextFormat.url<br />

property is an empty string or null, you can get or set this property, but the property will<br />

have no effect.<br />

Example<br />

The following example creates a text field with a hyperlink to the Macromedia website. The<br />

example uses TextFormat.target to display the Macromedia website in a new browser<br />

window.<br />

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

myformat.url = "http://www.macromedia.com";<br />

myformat.target = "_blank";<br />

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

mytext.multiline = true;<br />

mytext.wordWrap = true;<br />

mytext.border = true;<br />

mytext.html = true;<br />

mytext.text = "Go to Macromedia.com";<br />

mytext.setTextFormat(myformat);<br />

666 ActionScript classes

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

Saved successfully!

Ooh no, something went wrong!