User Guide

640 ActionScript classes
// >> distance: 0
}
To further demonstrate the relationships between filter_1, filter_2, and clonedFilter,
the following example below modifies the
knockout property of filter_1. Modifying
knockout demonstrates that the clone() method creates a new instance based on the values
of
filter_1 instead of pointing to them in reference.
import flash.filters.GradientGlowFilter;
var colors:Array = [0xFFFFFF, 0xFF0000, 0xFFFF00, 0x00CCFF];
var alphas:Array = [0, 1, 1, 1];
var ratios:Array = [0, 63, 126, 255];
var filter_1:GradientGlowFilter = new GradientGlowFilter(0, 45, colors,
alphas, ratios, 55, 55, 2.5, 2, "outer", false);
var filter_2:GradientGlowFilter = filter_1;
var clonedFilter:GradientGlowFilter = filter_1.clone();
trace(filter_1.knockout); // false
trace(filter_2.knockout); // false
trace(clonedFilter.knockout); // false
filter_1.knockout = true;
trace(filter_1.knockout); // true
trace(filter_2.knockout); // true
trace(clonedFilter.knockout); // false
colors (GradientGlowFilter.colors property)
public colors : Array
An array of colors that defines a gradient. For example, red is 0xFF0000, blue is 0x0000FF,
and so on.
The
colors property cannot be changed by directly modifying its values. Instead, you must
get a reference to
colors, make the change to the reference, and then set colors 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.
Availability: ActionScript 1.0; Flash Player 8