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
.
NO
TE
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.
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...