Getdepth (Textfield.getdepth 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

Example
In this example, you need to create a dynamic text field called
following ActionScript to embed fonts and rotate the text field. The string
font symbol in the library, with the linkage identifier name
that you have a font symbol in the library called
follows: the identifier set to
selected.
var my_fmt:TextFormat = new TextFormat();
my_fmt.font = "my font";
this.createTextField("my_txt", this.getNextHighestDepth(), 10, 10, 160,
120);
my_txt.wordWrap = true;
my_txt.embedFonts = true;
my_txt.text = "Hello world";
my_txt.setTextFormat(my_fmt);
my_txt._rotation = 45;

getDepth (TextField.getDepth method)

public getDepth() : Number
Returns the depth of a text field.
Availability: ActionScript 1.0; Flash Lite 2.0
Returns
- An integer.
Number
Example
The following example demonstrates text fields residing at different depths. Create a dynamic
text field on the Stage. Add the following ActionScript to your FLA or ActionScript file,
which dynamically creates two text fields at runtime and outputs their depths.
this.createTextField("first_mc", this.getNextHighestDepth(), 10, 10, 100,
22);
this.createTextField("second_mc", this.getNextHighestDepth(), 10, 10, 100,
22);
for (var prop in this) {
if (this[prop] instanceof TextField) {
var this_txt:TextField = this[prop];
trace(this_txt._name+" is a TextField at depth: "+this_txt.getDepth());
}
}
658
ActionScript classes
my font
and Export for ActionScript and Export in First Frame
my font
, and then use the
my_txt
my font
. The example assumes
my font
, with linkage properties set as
refers to a

Advertisement

Table of Contents
loading

Table of Contents