ActionScript 2.0 Language Reference |
|
|
|
| ActionScript classes > GlowFilter (flash.filters.GlowFilter) > GlowFilter constructor | |||
public GlowFilter([color:Number], [alpha:Number], [blurX:Number], [blurY:Number], [strength:Number], [quality:Number], [inner:Boolean], [knockout:Boolean])
Initializes a new GlowFilter instance with the specified parameters.
Availability: ActionScript 1.0; Flash Player 8
color:Number [optional] - The color of the glow, in the hexadecimal format 0xRRGGBB. The default value is 0xFF0000.
alpha:Number [optional] - The alpha transparency value for the color. Valid values are 0 to 1. For example, .25 sets a transparency value of 25%. The default value is 1.
blurX:Number [optional] - The amount of horizontal blur. Valid values are 0 to 255 (floating point). The default value is 6. Values that are a power of 2 (such as 2, 4, 8, 16 and 32) are optimized to render more quickly than other values.
blurY:Number [optional] - The amount of vertical blur. Valid values are 0 to 255 (floating point). The default value is 6. Values that are a power of 2 (such as 2, 4, 8, 16 and 32) are optimized to render more quickly than other values.
strength:Number [optional] - The strength of the imprint or spread. The higher the value, the more color is imprinted and the stronger the contrast between the glow and the background. Valid values are 0 to 255. The default is 2.
quality:Number [optional] - The number of times to apply the filter. Valid values are 0 to 15. The default value is 1, which is equivalent to low quality. A value of 2 is medium quality, and a value of 3 is high quality.
inner:Boolean [optional] - Specifies whether the glow is an inner glow. The value true indicates an inner glow. The default is false, an outer glow (a glow around the outer edges of the object).
knockout:Boolean [optional] - Specifies whether the object has a knockout effect. The value true makes the object's fill transparent and reveals the background color of the document. The default is false (no knockout effect).
The following example instantiates a new GlowFilter instance and applies it to a flat, rectangular shape.
import flash.filters.GlowFilter;
var rect:MovieClip = createRectangle(100, 100, 0x003366, "gradientGlowFilterExample");
var color:Number = 0x33CCFF;
var alpha:Number = 0.8;
var blurX:Number = 35;
var blurY:Number = 35;
var strength:Number = 2;
var quality:Number = 3;
var inner:Boolean = false;
var knockout:Boolean = false;
var filter:GlowFilter = new GlowFilter(color,
alpha,
blurX,
blurY,
strength,
quality,
inner,
knockout);
var filterArray:Array = new Array();
filterArray.push(filter);
rect.filters = filterArray;
function createRectangle(w:Number, h:Number, bgColor:Number, name:String):MovieClip {
var mc:MovieClip = this.createEmptyMovieClip(name, this.getNextHighestDepth());
mc.beginFill(bgColor);
mc.lineTo(w, 0);
mc.lineTo(w, h);
mc.lineTo(0, h);
mc.lineTo(0, 0);
mc._x = 20;
mc._y = 20;
return mc;
}
|
|
|
|