ActionScript 2.0 Language Reference |
|
|
|
| ActionScript classes > ConvolutionFilter (flash.filters.ConvolutionFilter) > preserveAlpha (ConvolutionFilter.preserveAlpha property) | |||
public preserveAlpha : Boolean
Indicates what the convolution applies to. A value of false indicates that the convolution applies to all channels, including the alpha channel. A value of true indicates that the convolution applies only to the color channels. The default value is true.
Availability: ActionScript 1.0; Flash Player 8
The following example changes the preserveAlpha property of filter from its default value of true to false.
import flash.filters.ConvolutionFilter;
import flash.display.BitmapData;
var preserveAlpha:Boolean = false;
var filter:ConvolutionFilter = new ConvolutionFilter(3, 3, [1, 1, 1, 1, 1, 1, 1, 1, 1], 9, 0, preserveAlpha);
var myBitmapData:BitmapData = new BitmapData(100, 80, true, 0xCCFF0000);
var mc:MovieClip = this.createEmptyMovieClip("mc", this.getNextHighestDepth());
mc.attachBitmap(myBitmapData, this.getNextHighestDepth());
myBitmapData.noise(128, 0, 255, 1 | 2 | 4 | 8, false);
mc.onPress = function() {
myBitmapData.applyFilter(myBitmapData, myBitmapData.rectangle, new Point(0, 0), filter);
}
|
|
|
|