Working with filters using ActionScript
523
square_mc.lineTo(40, 200);
square_mc.lineTo(40, 40);
square_mc.endFill();
/* GradientBevelFilter(distance:Number, angle:Number, colors:Array,
alphas:Array, ratios:Array, blurX:Number, blurY:Number, strength:Number,
quality:Number, type:String, knockout:Boolean) */
// create colors, alphas, and ratios arrays
var colors:Array = [0x0000FF, 0x00FF00, 0x9900FF, 0xFFFF00, 0xFF0000,
0xFFFF00, 0x9900FF, 0x00FF00,0x000000];//blue, green, purple, yellow,
red, yellow, purple, green, black
var alphas:Array = [1, 1, 1, 1, 1, 1, 1, 1, 1];
var ratios:Array = [16, 32, 64, 96, 128, 160, 192, 224, 235];
// create the filter object
var gradientBevel:GradientBevelFilter = new GradientBevelFilter(8, 225,
colors, alphas, ratios, 16, 16, 1.3, 2, "inner", false);
// apply the filter to the square movie clip
square_mc.filters = [gradientBevel];
Applying a gradient bevel filter
The GradientBevelFilter class lets you apply a gradient bevel effect to objects in Flash. A
gradient bevel is a beveled edge that’s enhanced with gradient color on the outside, inside, or
top of an object. Beveled edges bring a three-dimensional look to objects, and can have
colorful results as shown in the following figure.
For more information on this filter, see GradientBevelFilter
(flash.filters.GradientBevelFilter) in the
ActionScript 2.0 Language Reference
.
The following procedure uses the Drawing API to draw a square on the Stage, and applies a
gradient bevel filter to the shape.
Содержание FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
Страница 1: ...Learning ActionScript 2 0 in Flash...
Страница 8: ...8 Contents...
Страница 18: ...18 Introduction...
Страница 30: ...30 What s New in Flash 8 ActionScript...
Страница 66: ...66 Writing and Editing ActionScript 2 0...
Страница 328: ...328 Interfaces...
Страница 350: ...350 Handling Events...
Страница 590: ...590 Creating Interaction with ActionScript...
Страница 710: ...710 Understanding Security...
Страница 730: ...730 Debugging Applications...
Страница 780: ...780 Deprecated Flash 4 operators...
Страница 830: ...830 Index...