MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference page 506

Actionscript 2.0 language reference
Table of Contents

Advertisement

To apply filters to movie clips at runtime, use the
property of an object does not modify the object and can be undone by clearing the
property.
To apply filters to BitmapData instances, use the
Calling
applyFilter()
cannot be undone.
You can also apply filter effects to images and video at authoring time. For more information,
see your authoring documentation.
If you apply a filter to a movie clip or button, the
or button is set to
true
restored.
The filter uses the following formula:
dstPixel[x, y] = srcPixel[x + ((componentX(x, y) - 128) * scaleX) / 256, y +
((componentY(x, y) - 128) * scaleY) / 256]
where
componentX(x, y)
(x - mapPoint.x ,y - mapPoint.y)
The map image used by the filter is scaled to match the Stage scaling. It is not scaled in any
way when the object itself is scaled.
This filter supports Stage scaling, but not general scaling, rotation, or skewing. If the object
itself is scaled (if x-scale and y-scale are not 100%), the filter effect is not scaled. It is scaled
only when the Stage is zoomed in.
Here is how the DisplacementMapFilter class works. For each pixel (x,y) in the destination
bitmap, the DisplacementMapFilter class does the following:
Gets the color from (x,y) in the map bitmap
Calculates an offset based on that color
Looks up that offset location (x+dx,y+dy) in the source bitmap
Writes that pixel to the destination(x,y), if boundary conditions permit
A filter is not applied if the resulting image would exceed 2880 pixels in width or height. For
example, if you zoom in on a large movie clip with a filter applied, the filter is turned off if the
resulting image reaches the 2880-pixel limit.
Availability: ActionScript 1.0; Flash Player 8
See also
applyFilter (BitmapData.applyFilter method)
,
property)
cacheAsBitmap (MovieClip.cacheAsBitmap property)
506
ActionScript classes
on a BitmapData object modifies that BitmapData object and
. If you clear all filters, the original value of
gets the
componentX
.
property. Setting the
filters
BitmapData.applyFilter()
property of the movie clip
cacheAsBitmap
cacheAsBitmap
color value from the
,
filters (MovieClip.filters
filters
filters
method.
is
property at
mapBitmap

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF