EasyManua.ls Logo

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

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 503
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.
About hit detection, rotating, skewing, and
scaling filters
No filtered region (drop shadow, for example) outside of a movie clip instances bounding box
rectangle is considered to be part of the surface for hit detection purposes (determining if an
instance overlaps or intersects with another instance). Because hit detection is vector-based,
you cannot perform a hit detection on the bitmap result. For example, if you apply a bevel
filter to a button instance, hit detection is not available on the beveled portion of the instance.
Scaling, rotating, and skewing are not supported by filters; if the instance itself is scaled
(
_xscale and _yscale are not 100%), the filter effect does not scale with the instance. This
means that the original shape of the instance rotates, scales, or skews; however, the filter does
not rotate, scale, or skew with the instance.
You can animate an instance with a filter to create realistic effects, or nest instances and use
the BitmapData class to animate filters to achieve this effect.
Applying filters to object instances and BitmapData
instances
The use of filters depends on the object instance to which you apply the filter. Use the
following guidelines when you apply a filter to an object or BitmapData instance:
To apply filters to movie clips, text fields, and buttons at runtime, use the filters
property. Setting the
filters property of an object does not modify the object and can be
undone by clearing the
filters property.
To ap p l y fi l ter s to Bitm a p Data instances, use the BitmapData.applyFilter() method.
Calling
applyFilter() on a BitmapData object modifies that BitmapData object and
cannot be undone.
NOTE
(Flash Professional 8 only) You can also apply filter effects to images and video
during authoring using the Filters tab in the Property inspector.

Table of Contents

Related product manuals