EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Color (Convolutionfilter.color Property)

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
1378 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
464 ActionScript classes
filter_1.bias = 20;
trace(filter_1.bias); // 20
trace(filter_2.bias); // 20
trace(clonedFilter.bias); // 0
color (ConvolutionFilter.color property)
public color : Number
The hexadecimal color to substitute for pixels that are off the source image. This is an RGB
value with no alpha component. The default is 0.
Availability: ActionScript 1.0; Flash Player 8
Example
The following example changes the
color property of filter from its default value of 0 to
0xFF0000.
import flash.filters.ConvolutionFilter;
import flash.display.BitmapData;
import flash.geom.Rectangle;
import flash.geom.Point;
var color:Number = 0x0000FF;
var filter:ConvolutionFilter = new ConvolutionFilter(3, 3, [1, 1, 1, 1, 1,
1, 1, 1, 1], 9, 0, true, false, color, 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);
var height:Number = 100;
var width:Number = 80;
mc.onPress = function() {
height -= 2;
width -= 2;
myBitmapData.applyFilter(myBitmapData, new Rectangle(0, 0, height,
width), new Point(2, 2), filter);
}

Table of Contents

Related product manuals