522
Animation, Filters, and Drawings
The following figure shows the gradient bevel filter created by the code above, a nine-color
rainbow bevel applied to a red rectangle movie clip:
The dashed line shows how angles are determined. The figure shows how the angle of 225° is
realized on the filter, and also shows each ratio value for each color. Setting the angle at 225°
indicates that the first color in the array begins at 225°, which is in the top left corner (the
highlight). The dotted line shows where the highlight gradient is applied and where the
shadow gradient is applied.
The original movie clip color is pink, but setting the 128 value to red means the 128-pixel
value is the base fill and covers the original movie clip fill. However, when you set the filters
property, the original object is not altered; by simply clearing the
filters
property, you can
restore the original movie clip fill.
The properties of all filters affect each other, so if you adjust one property to change the effect
that you’re applying, you might need to adjust another property as well.
The full ActionScript code to create the previous figure is as follows:
import flash.filters.GradientBevelFilter;
// draws a filled square shape
this.createEmptyMovieClip("square_mc", this.getNextHighestDepth());
square_mc.beginFill(0xFF99CC);
square_mc.moveTo(40, 40);
square_mc.lineTo(200, 40);
square_mc.lineTo(200, 200);
Summary of Contents for FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
Page 1: ...Learning ActionScript 2 0 in Flash...
Page 8: ...8 Contents...
Page 18: ...18 Introduction...
Page 30: ...30 What s New in Flash 8 ActionScript...
Page 66: ...66 Writing and Editing ActionScript 2 0...
Page 328: ...328 Interfaces...
Page 350: ...350 Handling Events...
Page 590: ...590 Creating Interaction with ActionScript...
Page 710: ...710 Understanding Security...
Page 730: ...730 Debugging Applications...
Page 780: ...780 Deprecated Flash 4 operators...
Page 830: ...830 Index...