User Guide

MovieClip 859
If the filters array is empty, you need not use a temporary array. Instead, you can directly
assign an array literal that contains one or more filter objects that you created.
To modify an existing filter object, whether it was created at design-time or at runtime, you
must use the technique of modifying a copy of the
filters array:
Assign the value of the myMC.filters array to a temporary array, such as one named
myFilters.
Modify the property using the temporary array, myFilters. For example, if you want to
set the quality property of the first filter in the array, you could use the following code:
myList[0].quality = 1;
Assign the value of the temporary array to the myMC.filters array.
To clear the filters for a movie clip, set
filters to an empty array ([]).
At load time, if a movie clip has an associated filter, it is marked to cache itself as a transparent
bitmap. From this point forward, as long as the movie clip has a valid filter list, the player
caches the movie clip as a bitmap. This source bitmap is used as a source image for the filter
effects. Each movie clip usually has two bitmaps: one with the original unfiltered source
movie clip and another for the final image after filtering. The final image is used when
rendering. As long as the movie clip does not change, the final image does not need updating.
If you are working with a
filters array that contains multiple filters and you need to track
the type of filter assigned to each array index, you can maintain your own
filters array and
use a separate data structure to track the type of filter associated with each array index. There
is no simple way to determine the type of filter associated with each
filters array index.
Availability: ActionScript 1.0; Flash Player 8
Example
The following example adds a drop shadow filter to a movie clip named
myMC:
var myDropFilter = new flash.filters.DropShadowFilter();
var myFilters:Array = myMC.filters;
myFilters.push(myDropFilter);
myMC.filters = myFilters;
The following example changes the quality setting of the first filter in the array to 15 (this
example works only if at least one filter object has been associated with the
myMC movie clip):
var myList:Array = myMC.filters;
myList[0].quality = 15;
myMC.filters = myList;
See also