1180
ActionScript classes
getFontList (TextField.getFontList method)
public static getFontList() : Array
Returns the names of fonts on the player's host system as an array. (This method does not
return names of all fonts in currently loaded SWF files.) The names are of type
String
. This
method is a static method of the global TextField class. You cannot specify a text field instance
when you call this method.
Availability:
ActionScript 1.0; Flash Player 6
Returns
Array
- An array of font names.
Example
The following code displays a font list returned by
getFontList()
:
var font_array:Array = TextField.getFontList();
font_array.sort();
trace("You have "+font_array." fonts currently installed");
trace("--------------------------------------");
for (var i = 0; i<font_array.length; i++) {
trace("Font #"+(i+1)+":\t"+font_array[i]);
}
getNewTextFormat (TextField.getNewTextFormat
method)
public getNewTextFormat() : TextFormat
Returns a TextFormat object containing a copy of the text field's text format object. The text
format object is the format that newly inserted text, such as text inserted with the
replaceSel()
method or text entered by a user, receives. When
getNewTextFormat()
is
invoked, the TextFormat object returned has all of its properties defined. No property is
null
.
Availability:
ActionScript 1.0; Flash Player 6
Returns
TextFormat
- A TextFormat object.
Example
The following example displays the specified text field's (
my_txt
) text format object.
this.createTextField("my_txt", this.getNextHighestDepth(), 10, 10, 160,
120);
var my_fmt:TextFormat = my_txt.getNewTextFormat();
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...