Example
The following example creates three GradientGlowFilter objects and compares them;
is created by using the GradientGlowFilter construtor;
filter_1
setting it equal to
filter_1
although
evaluates as being equal to
filter_2
contains the same values as
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 == filter_2); // true
trace(filter_1 == clonedFilter); // false
for(var i in filter_1) {
trace(">> " + i + ": " + filter_1[i]);
// >> clone: [type Function]
// >> type: outer
// >> knockout: false
// >> strength: 2.5
// >> quality: 2
// >> blurY: 55
// >> blurX: 55
// >> ratios: 0,63,126,255
// >> alphas: 0,1,1,1
// >> colors: 16777215,16711680,16776960,52479
// >> angle: 45
// >> distance: 0
}
for(var i in clonedFilter) {
trace(">> " + i + ": " + clonedFilter[i]);
// >> clone: [type Function]
// >> type: outer
// >> knockout: false
// >> strength: 2.5
// >> quality: 2
// >> blurY: 55
// >> blurX: 55
// >> ratios: 0,63,126,255
// >> alphas: 0,1,1,1
// >> colors: 16777215,16711680,16776960,52479
// >> angle: 45
; and,
clonedFilter
filter_1
, does not.
filter_1
GradientGlowFilter (flash.filters.GradientGlowFilter)
filter_2
is created by cloning
,
clonedFilter
is created by
. Notice that
filter_1
, even though it
639
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?