To modify a filter's properties when applied to a movie clip instance:
1.
Create a new Flash document and save the file as modifyFilter.fla.
2.
Add the following ActionScript to Frame 1 of the Timeline:
this.createEmptyMovieClip("my_mc", 10);
// draw square
with (my_mc) {
beginFill(0xFF0000, 100);
moveTo(0, 0);
lineTo(100, 0);
lineTo(100, 100);
lineTo(0, 100);
lineTo(0, 0);
endFill();
}
my_mc._x = 100;
my_mc._y = 100;
// use default DropShadowFilter values
my_mc.filters = [new flash.filters.DropShadowFilter()];
trace(my_mc.filters[0].distance); // 4
var filter_array:Array = my_mc.filters;
filter_array[0].distance = 10;
my_mc.filters = filter_array;
trace(my_mc.filters[0].distance); // 10
The first section of this code uses the Drawing API to create a red square, and positions
the shape on the Stage. The second section of code applies a drop shadow filter to the
square. Next, the code creates a temporary array to hold the current filters to apply to the
red square on the Stage. The
the modified filter is reapplied to the
3.
Select Control > Test Movie to test the document.
Currently, no support is available for having any filters perform rotation based upon
their parent's rotation or some sort of other rotation. The blur filter always blurs
perfectly horizontally or vertically, independently of the rotation or skew of any item
in the parent object tree.
Filtered content has the same restrictions on size as content with its
property set to
longer visible when the bitmap representation is greater than 2880 pixels in either
direction. When you publish SWF files with filters, it is a good idea to disable the
zoom menu options.
502
Animation, Filters, and Drawings
property of the first filter is set to 10 pixels, and
distance
my_mc
. If the author zooms in too far on the SWF file, the filters are no
true
movie clip instance.
cacheAsBitmap
Need help?
Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?