MACROMEDIA FLASH 8-EXTENDING FLASH Manual page 45

Extending flash
Table of Contents

Advertisement

Example
The following code tests whether the current selection is a bitmap, and then sets the height of
the bitmap to 150 pixels:
var isBitmap = fl.getDocumentDOM().selection[0].instanceType;
if(isBitmap == "bitmap"){
var bits = fl.getDocumentDOM().selection[0].getBits();
bits.height = 150;
fl.getDocumentDOM().selection[0].setBits(bits);
}
See also
bitmapInstance.getBits()
bitmapInstance.vPixels
Availability
Flash MX 2004.
Usage
bitmapInstance.vPixels
Description
Read-only property; an integer that represents the height of the bitmap—that is, the number
of pixels in the vertical dimension.
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
BitmapInstance object
45

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-EXTENDING FLASH and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash 8

Table of Contents