EasyManua.ls Logo

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH - Page 499

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
830 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Using filter effects 499
This code completes two different functionalities. The first section creates and positions a
movie clip instance, and draws a black rounded rectangle on the Stage. The second block
of code applies a glow filter to the rectangle on the Stage and defines an
onEnterFrame
event handler, which is responsible for animating the filter effect. The
onEnterFrame
event handler animates the glow filter between a blur of 10 and 30 pixels, and after the
animation is greater than or equal to 30, or less than or equal to 10, the direction of the
animation reverses.
3. Save your changes to the Flash document and select Control > Test Movie to test the
SWF file.
For more information on working with filters in an application, see the following topics:
“Working with filter packages” on page 499
“Working with filters, caching, and the MovieClip class” on page 501
About hit detection, rotating, skewing, and scaling filters” on page 503
Applying filters to object instances and BitmapData instances” on page 503
About error handling, performance, and filters” on page 504
For an example of using ActionScript to apply filters, you can find a sample source file,
Filters.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\Filters.
On the Macintosh, browse to Macintosh HD/Applications/Macromedia Flash 8/Samples
and Tutorials/Samples/ActionScript/Filters.
Working with filter packages
Packages are directories that contain one or more class files and reside in a designated
classpath directory. For example, the flash.filters package is a directory on your hard disk that
contains several class files for each filter type (such as BevelFilter, BlurFilter,
DropShadowFilter, and so on) in Flash 8. When class files are organized this way, you must
access the classes in a specific way. You either import the class, or reference it using a fully
qualified name.
NOTE
To use the import statement, you must specify ActionScript 2.0 and Flash Player 6 or
later in the Flash tab of your FLA file’s Publish Settings dialog box.

Table of Contents

Related product manuals