03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

1,1,1,<br />

1,1,1 ];<br />

var filter:ConvolutionFilter = new ConvolutionFilter(matrixCols,<br />

matrixRows, matrix, matrix.length, bias, preserveAlpha, clamp,<br />

clampColor, clampAlpha);<br />

var largeBoxWidth:Number = 100;<br />

var largeBoxHeight:Number = 100;<br />

var largeBox:BitmapData = new BitmapData(largeBoxWidth, largeBoxWidth,<br />

true, 0xCC00FF00);<br />

var smallBoxWidth:Number = largeBoxWidth / 2;<br />

var smallBoxHeight:Number = largeBoxHeight / 2;<br />

var smallBox:BitmapData = new BitmapData(smallBoxWidth, smallBoxWidth,<br />

true, 0xCC0000FF);<br />

var mc:MovieClip = this.createEmptyMovieClip("mc",<br />

this.getNextHighestDepth());<br />

mc.attachBitmap(largeBox, this.getNextHighestDepth());<br />

mc.onPress = function() {<br />

largeBox.applyFilter(smallBox, new Rectangle(0,0, largeBoxWidth,<br />

largeBoxHeight), new Point(0,0), filter);<br />

}<br />

clone (ConvolutionFilter.clone method)<br />

public clone() : ConvolutionFilter<br />

Returns a copy of this filter object.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 8<br />

Returns<br />

ConvolutionFilter - A new ConvolutionFilter instance with all the same properties as the<br />

original one.<br />

Example<br />

The following example creates three ConvolutionFilter objects <strong>and</strong> compares them: filter_1<br />

is created by using the ConvolutionFilter constructor; filter_2 is created by setting it<br />

equal to filter_1; <strong>and</strong> clonedFilter is created by cloning filter_1. Notice that although<br />

filter_2 evaluates as being equal to filter_1, clonedFilter, even though it contains the<br />

same values as filter_1, does not.<br />

import flash.filters.ConvolutionFilter;<br />

468 <strong>ActionScript</strong> classes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!