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

Actionscript 2.0 language reference
Table of Contents

Advertisement

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
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);
}
464
ActionScript classes
property of
color
filter
from its default value of 0 to

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF