ActionScript 2.0 Language Reference |
|
|
|
| ActionScript classes > ConvolutionFilter (flash.filters.ConvolutionFilter) > alpha (ConvolutionFilter.alpha property) | |||
public alpha : Number
The alpha transparency value of the substitute color. Valid values are 0 to 1.0. The default is 0. For example, 0.25 sets a transparency value of 25 percent.
Availability: ActionScript 1.0; Flash Player 8
The following example changes the alpha property of filter from its default value of 1 to 0.35.
import flash.filters.ConvolutionFilter;
import flash.display.BitmapData;
import flash.geom.Rectangle;
import flash.geom.Point;
var alpha:Number = 0.35;
var filter:ConvolutionFilter = new ConvolutionFilter(3, 3, [1, 1, 1, 1, 1, 1, 1, 1, 1], 9, 0, true, false, 0x0000FF, alpha);
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);
}
|
|
|
|