User Guide
318 ActionScript classes
var mc:MovieClip = this.createEmptyMovieClip("mc",
this.getNextHighestDepth());
mc.attachBitmap(myBitmapData, this.getNextHighestDepth());
merge (BitmapData.merge method)
public merge(sourceBitmap:BitmapData, sourceRect:Rectangle,
destPoint:Point, redMult:Number, greenMult:Number, blueMult:Number,
alphaMult:Number) : Void
Performs per-channel blending from a source image to a destination image. The following
formula is used for each channel:
new red dest = (red source * redMult) + (red dest * (256 - redMult) / 256;
The redMult, greenMult, blueMult, and alphaMult values are the multipliers used for each
color channel. Their valid range is from 0 to 256.
Availability: ActionScript 1.0; Flash Player 8
Parameters
sourceBitmap:flash.display.BitmapData - The input bitmap image to use. The source
image can be a different BitmapData object, or it can refer to the current BitmapData object.
sourceRect:flash.geom.Rectangle - A rectangle that defines the area of the source image
to use as input.
destPoint:flash.geom.Point - The point within the destination image (the current
BitmapData instance) that corresponds to the upper-left corner of the source rectangle.
redMult:Number - A number by which to multiply the red channel value.
greenMult:Number - A number by which to multiply the green channel value.
blueMult:Number - A number by which to multiply the blue channel value.
alphaMult:Number - A number by which to multiply the alpha transparency value.
Example
The following example shows how to merge part of one
BitmapData with another.
import flash.display.BitmapData;
import flash.geom.Rectangle;
import flash.geom.Point;
var bitmapData_1:BitmapData = new BitmapData(100, 80, false, 0x00CCCCCC);
var bitmapData_2:BitmapData = new BitmapData(100, 80, false, 0x00FF0000);
var mc_1:MovieClip = this.createEmptyMovieClip("mc",
this.getNextHighestDepth());
mc_1.attachBitmap(bitmapData_1, this.getNextHighestDepth());