The preceding code creates a new instance of the drop shadow filter and gives it the name
greenDropShadow
DropShadowFilter.clone()
. Both the green drop shadow and red drop shadow filters are applied to
redDropShadow
the
movie clip instance on the Stage. If you did not call the
flower_mc
both drop shadows would appear red. The reason for this appearance is that setting the
redDropShadow.color
shadow objects because the red drop shadow contains a reference to the green drop
shadow.
5.
Select Control > Test Movie to test the Flash document.
The filter is duplicated and cloned, and both filters are applied to the
For more information on the
method) in the ActionScript 2.0 Language Reference. For related information, you can also
see the
method of any filter class.
clone()
Creating bitmaps with the BitmapData
class
The BitmapData class lets you create arbitrarily sized transparent or opaque bitmap images,
then manipulate them in various ways at runtime. When you manipulate a BitmapData
instance directly by using ActionScript, you can create very complex images without incurring
the overhead of constantly redrawing the content from vector data in Flash Player. The
methods of the BitmapData class support a variety of effects that are not available through the
Filters tab in the Flash workspace.
A BitmapData object contains an array of pixel data. This data either can represent a fully
opaque bitmap or a transparent bitmap that contains alpha channel data. Either type of
BitmapData object is stored as a buffer of 32-bit integers. Each 32-bit integer determines the
properties of a single pixel in the bitmap. Each 32-bit integer is a combination of four 8-bit
channel values (from 0 to 255) that describe the alpha transparency and the red, green, and
blue (ARGB) values of the pixel.
For information on working with packages, see
You can find a sample source file that uses the BitmapData class to manipulate an image. Find
the file called BitmapData.fla in the Samples folder on your hard disk.
In Windows, browse to boot drive\Program Files\Macromedia\Flash 8\Samples and
Tutorials\Samples\ActionScript\BitmapData.
534
Animation, Filters, and Drawings
. The green drop shadow object is duplicated by using the
method and creates a new filter object called
property changes both the red drop shadow and green drop
method, see clone (DropShadowFilter.clone
clone()
"Working with filter packages" on page
method,
clone()
instance.
flower_mc
499.
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?