beautypg.com

Fontitem.font, Fontitem.isdefinefont4symbol – Adobe Extending Flash Professional CS5 User Manual

Page 305

background image

283

EXTENDING FLASH PROFESSIONAL

fontItem object

Last updated 5/2/2011

fontItem.font

Availability
Flash CS4 Professional.

Usage

fontItem.font

Description
Property; a string that specifies the name of the device font associated with the Font item. If you enter a string that does
not correspond to an installed device font, an error message is displayed. To determine if a font exists on the system,
use

fl.isFontInstalled()

.

Note: When you set this value, the resulting property value might be different from the string you enter. See the following
example.

Example
Assuming that the first item in the Library is a Font item, the following code displays the name of the device font
currently associated with the Font item, then changes it to Times:

fl.outputPanel.clear();
var theItem = fl.getDocumentDOM().library.items[0];
fl.trace(theItem.font);
theItem.font = "Times";
// depending on your system, the following may display something like "Times-Roman"
fl.trace(theItem.font);

fontItem.isDefineFont4Symbol

Availability
Flash CS4 Professional.

Usage

fontItem.isDefineFont4Symbol

Description
Property; a Boolean value that specifies the format of the font that is output when publishing a SWF file. If this value
is

true

, Flash outputs a font that can be used with the flash.text.engine (FTE) APIs. If this value is

false

, the font can

be used with the flash.text APIs, including text fields. The default value is

false

.

Example
See

fontItem.embedVariantGlyphs

.

This manual is related to the following products: