User Guide

GradientGlowFilter (flash.filters.GradientGlowFilter) 647
art.lineTo(0, h);
art.lineTo(0, 0);
art._x = 20;
art._y = 20;
var colors:Array = [0xFFFFFF, 0xFF0000, 0xFFFF00, 0x00CCFF];
var alphas:Array = [0, 1, 1, 1];
var ratios:Array = [0, 63, 126, 255];
var filter:GradientGlowFilter = new GradientGlowFilter(0, 45, colors,
alphas, ratios, 55, 55, 2.5, 2, "outer", false);
var filterArray:Array = new Array();
filterArray.push(filter);
art.filters = filterArray;
return art;
}
ratios (GradientGlowFilter.ratios property)
public ratios : Array
An array of color distribution ratios for the corresponding colors in the colors array. Valid
values are 0 to 255.
The
ratios property cannot be changed by directly modifying its values. Instead, you must
get a reference to
ratios, make the change to the reference, and then set ratios to the
reference.
The
colors, alphas, and ratios properties are all related. The first element in the colors
array corresponds to the first element in the
alphas array and in the ratios array, and so on.
Think of the gradient glow filter as a glow that emanates from the center of the object (if the
distance value is set to 0), with gradients that are stripes of color blending into each other.
The first color in the
colors array is the outermost color of the glow. The last color is the
innermost color of the glow.
Each value in the
ratios array sets the position of the color on the radius of the gradient,
where 0 represents the outermost point of the gradient and 255 represents the innermost
point of the gradient. The ratio values can range from 0 to 255 pixels, in increasing value; for
example [0, 64, 128, 200, 255]. Values from 0 to 128 appear on the outer edges of the glow.
Values from 129 to 255 appear in the inner area of the glow. Depending on the ratio values of
the colors and the
type value of the filter, the filter colors might be obscured by the object to
which the filter is applied.