EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Page 639

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
1378 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
GradientGlowFilter (flash.filters.GradientGlowFilter) 639
Example
The following example creates three GradientGlowFilter objects and compares them;
filter_1 is created by using the GradientGlowFilter construtor; filter_2 is created by
setting it equal to
filter_1; and, clonedFilter is created by cloning filter_1. Notice that
although
filter_2 evaluates as being equal to filter_1, clonedFilter, even though it
contains the same values as
filter_1, does not.
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

Table of Contents

Related product manuals