User Guide

BitmapData (flash.display.BitmapData) 331
transparent (BitmapData.transparent property)
public transparent : Boolean [read-only]
Defines whether the bitmap image supports per-pixel transparency. You can set this value only
when you construct a BitmapData object by passing in
true for the transparent parameter.
After you create a BitmapData object, you can check whether it supports per-pixel
transparency by seeing if the value of the
transparent property is true.
Availability: ActionScript 1.0; Flash Player 8
Example
The following example shows that the
transparent property of the Bitmap instance is read-
only by trying to set it and failing:
import flash.display.BitmapData;
var myBitmapData:BitmapData = new BitmapData(100, 80, false, 0x00CCCCCC);
var mc:MovieClip = this.createEmptyMovieClip("mc",
this.getNextHighestDepth());
mc.attachBitmap(myBitmapData, this.getNextHighestDepth());
trace(myBitmapData.transparent); // false
myBitmapData.transparent = true;
trace(myBitmapData.transparent); // false
width (BitmapData.width property)
public width : Number [read-only]
The width of the bitmap image in pixels.
Availability: ActionScript 1.0; Flash Player 8
Example
The following example shows that the
width property of the Bitmap instance is read-only by
trying to set it and failing:
import flash.display.BitmapData;
var myBitmapData:BitmapData = new BitmapData(100, 80, false, 0x00CCCCCC);
var mc:MovieClip = this.createEmptyMovieClip("mc",
this.getNextHighestDepth());
mc.attachBitmap(myBitmapData, this.getNextHighestDepth());
trace(myBitmapData.width); // 100
myBitmapData.width = 999;
trace(myBitmapData.width); // 100