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.

filter_1.bias = 20;<br />

trace(filter_1.bias); // 20<br />

trace(filter_2.bias); // 20<br />

trace(clonedFilter.bias); // 0<br />

color (ConvolutionFilter.color property)<br />

public color : Number<br />

The hexadecimal color to substitute for pixels that are off the source image. This is an RGB<br />

value with no alpha component. The default is 0.<br />

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

Example<br />

The following example changes the color property of filter from its default value of 0 to<br />

0xFF0000.<br />

import flash.filters.ConvolutionFilter;<br />

import flash.display.BitmapData;<br />

import flash.geom.Rectangle;<br />

import flash.geom.Point;<br />

var color:Number = 0x0000FF;<br />

var filter:ConvolutionFilter = new ConvolutionFilter(3, 3, [1, 1, 1, 1, 1,<br />

1, 1, 1, 1], 9, 0, true, false, color, 1);<br />

var myBitmapData:BitmapData = new BitmapData(100, 80, true, 0xCCFF0000);<br />

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

this.getNextHighestDepth());<br />

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

myBitmapData.noise(128, 0, 255, 1 | 2 | 4 | 8, false);<br />

var height:Number = 100;<br />

var width:Number = 80;<br />

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

height -= 2;<br />

width -= 2;<br />

myBitmapData.applyFilter(myBitmapData, new Rectangle(0, 0, height,<br />

width), new Point(2, 2), filter);<br />

}<br />

470 <strong>ActionScript</strong> classes

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

Saved successfully!

Ooh no, something went wrong!