Bitmapitem.quality, Bitmapitem.sourcefileexists – Adobe Extending Flash Professional CS5 User Manual

Page 60

Advertising
background image

38

EXTENDING FLASH PROFESSIONAL

BitmapItem object

Last updated 5/2/2011

Description
Read-only property; a string that specifies whether the specified item was imported as an jpeg file. Possible values for
this property are “photo” (for jpeg files) and “lossless” (for uncompressed file types such as GIF and PNG).

Example
Assuming that the first item in the Library is a bitmap item, the following code displays "photo" if the file was imported
into the Library as a jpeg file, or "lossless" if is was not:

var libItem = fl.getDocumentDOM().library.items[0];
fl.trace("Imported compression type = "+ libItem.originalCompressionType);

See also

bitmapItem.compressionType

bitmapItem.quality

Availability
Flash MX 2004.

Usage

bitmapItem.quality

Description
Property; an integer that specifies the quality of the bitmap. To use the default document quality, specify -1; otherwise,
specify an integer from 0 to 100. Available only for JPEG compression.

Example
The following code sets the

quality

property of the first item in the library of the current document to 65:

fl.getDocumentDOM().library.items[0].quality = 65;

alert(fl.getDocumentDOM().library.items[0].quality);

bitmapItem.sourceFileExists

Availability
Flash CS4 Professional.

Usage

bitmapItem.sourceFileExists

Description
Read-only property; a Boolean value of

true

if the file that was imported to the Library still exists in the location from

where it was imported;

false

otherwise.

Advertising
This manual is related to the following products: