Adobe Extending Flash Professional CS4 User Manual

Page 57

background image

35

EXTENDING FLASH CS4 PROFESSIONAL

BitmapInstance object

Example
The following code gets the height of the bitmap in pixels:

// Get the number of pixels in the vertical dimension.

var bmObj = fl.getDocumentDOM().selection[0];

var isBitmap = bmObj.instanceType;

if(isBitmap == "bitmap"){

var numVerticalPixels = bmObj.vPixels;

}

See also

bitmapInstance.hPixels