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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

my_txt.addListener(txtListener);<br />

The MovieClip.getNextHighestDepth() method used in this example requires Flash Player<br />

7 or later. If your SWF file includes a version 2 component, use the version 2 components'<br />

DepthManager class instead of the MovieClip.getNextHighestDepth() method.<br />

See also<br />

onChanged (TextField.onChanged h<strong>and</strong>ler), onScroller (TextField.onScroller<br />

h<strong>and</strong>ler), removeListener (TextField.removeListener method)<br />

_alpha (TextField._alpha property)<br />

public _alpha : Number<br />

Sets or retrieves the alpha transparency value of the text field. Valid values are 0 (fully<br />

transparent) to 100 (fully opaque). The default value is 100. Transparency values are not<br />

supported for text fields that use device fonts. You must use embedded fonts to use the<br />

_alpha transparency property with a text field.<br />

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

Example<br />

The following code sets the _alpha property of a text field named my_txt to 20%. Create a<br />

new font symbol in the library by selecting New Font from the Library options menu. Then<br />

set the linkage of the font to my font. Set the linkage for a font symbol to my font. Add the<br />

following <strong>ActionScript</strong> code to your FLA or AS file.<br />

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

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

// where 'my font' is the linkage name of a font in the Library<br />

this.createTextField("my_txt", this.getNextHighestDepth(), 10, 10, 100,<br />

22);<br />

my_txt.border = true;<br />

my_txt.embedFonts = true;<br />

my_txt.text = "Hello World";<br />

my_txt.setTextFormat(my_fmt);<br />

my_txt._alpha = 20;<br />

The MovieClip.getNextHighestDepth() method used in this example requires Flash Player<br />

7 or later. If your SWF file includes a version 2 component, use the version 2 components'<br />

DepthManager class instead of the MovieClip.getNextHighestDepth() method.<br />

See also<br />

_alpha (Button._alpha property), _alpha (MovieClip._alpha property)<br />

1188 <strong>ActionScript</strong> classes

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

Saved successfully!

Ooh no, something went wrong!