User Guide

462 ActionScript classes
Example
The following example changes the
clamp property of filter from its default value of true
to
false.
import flash.filters.ConvolutionFilter;
import flash.display.BitmapData;
import flash.geom.Rectangle;
import flash.geom.Point;
var clamp:Boolean = false;
var filter:ConvolutionFilter = new ConvolutionFilter(3, 3, [1, 1, 1, 1, 1,
1, 1, 1, 1], 9, 0, true, clamp, 0x00FF00, 1);
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, new Rectangle(0, 0, 98, 78), new
Point(2, -2), filter);
}
clone (ConvolutionFilter.clone method)
public clone() : ConvolutionFilter
Returns a copy of this filter object.
Availability: ActionScript 1.0; Flash Player 8
Returns
flash.filters.ConvolutionFilter - A new ConvolutionFilter instance with all the same
properties as the original one.
Example
The following example creates three ConvolutionFilter objects and compares them:
filter_1
is created by using the
ConvolutionFilter constructor; filter_2 is created by setting it
equal to
filter_1; and clonedFilter is created by cloning filter_1. Notice that although
filter_2 evaluates as being equal to filter_1, clonedFilter, even though it contains the
same values as
filter_1, does not.
import flash.filters.ConvolutionFilter;