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("first_mc", this.getNextHighestDepth(), 10, 10, 100,<br />

22);<br />

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

22);<br />

for (var prop in this) {<br />

if (this[prop] instanceof TextField) {<br />

var this_txt:TextField = this[prop];<br />

trace(this_txt._name+" is a TextField at depth: "+this_txt.getDepth());<br />

}<br />

}<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 />

getFontList (TextField.getFontList method)<br />

public static getFontList() : Array<br />

Returns the names of fonts on the player's host system as an array. (This method does not<br />

return names of all fonts in currently loaded SWF files.) The names are of type String. This<br />

method is a static method of the global TextField class. You cannot specify a text field instance<br />

when you call this method.<br />

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

Returns<br />

Array - An array of font names.<br />

Example<br />

The following code displays a font list returned by getFontList():<br />

var font_array:Array = TextField.getFontList();<br />

font_array.sort();<br />

trace("You have "+font_array.length+" fonts currently installed");<br />

trace("--------------------------------------");<br />

for (var i = 0; i

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

Saved successfully!

Ooh no, something went wrong!