trace(bitmap_1.width); // 100
trace(bitmap_1.height); // 80
trace(bitmap_1.transparent); // true
var bitmap_2:BitmapData = new BitmapData(width, height);
trace(bitmap_2.width); // 100
trace(bitmap_2.height); // 80
trace(bitmap_2.transparent); // true
clone (BitmapData.clone method)
public clone() : BitmapData
Returns a new BitmapData object that is a clone of the original instance with an exact copy of
the contained bitmap.
Availability: ActionScript 1.0; Flash Player 8
Returns
flash.display.BitmapData
Example
The following example creates three BitmapData objects and compares them. You can create
the
instance by using the
bitmap_1
instance by setting it equal to
. Notice that although
bitmap_1
does not, even though it contains the same values as
clonedBitmap
import flash.display.BitmapData;
var bitmap_1:BitmapData = new BitmapData(100, 80, false, 0x000000);
var bitmap_2:BitmapData = bitmap_1;
var clonedBitmap:BitmapData = bitmap_1.clone();
trace(bitmap_1 == bitmap_2); // true
trace(bitmap_1 == clonedBitmap); // false
for(var i in bitmap_1) {
trace(">> " + i + ": " + bitmap_1[i]);
// >> generateFilterRect: [type Function]
// >> dispose: [type Function]
// >> clone: [type Function]
// >> copyChannel: [type Function]
// >> noise: [type Function]
// >> merge: [type Function]
300
ActionScript classes
- A new BitmapData object that is identical to the original.
constructor. You create the
BitmapData
. You create he
bitmap_1
evaluates as being equal to
bitmap_2
instance by cloning
clonedBitmap
bitmap_1
bitmap_1
bitmap_2
,
.
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?