518
ActionScript classes
componentX
:Number
- Describes which color channel to use in the map image to displace the
x
result. Possible values are the following:
■
1
(red)
■
2
(green)
■
4
(blue)
■
8
(alpha)
componentY
:Number
- Describes which color channel to use in the map image to displace the
y
result. Possible values are the following:
■
1
(red)
■
2
(green)
■
4
(blue)
■
8
(alpha)
scaleX
:Number
- The multiplier to use to scale the
x
displacement result from the map
calculation.
scaleY
:Number
- The multiplier to use to scale the
y
displacement result from the map
calculation.
mode
:String
[optional] - The mode of the filter. Possible values are the following:
■
"wrap"
— Wraps the displacement value to the other side of the source image.
■
"clamp"
— Clamps the displacement value to the edge of the source image.
■
"ignore"
— If the displacement value is out of range, ignores the displacement and uses
the source pixel.
■
"color"
— If the displacement value is outside the image, substitutes a pixel value
composed of the
alpha
and
color
properties of the filter.
color
:Number
[optional] - Specifies the color to use for out-of-bounds displacements. The
valid range of displacements is 0.0 to 1.0. Use this parameter if
mode
is set to
"color"
.
alpha
:Number
[optional] - Specifies what alpha value to use for out-of-bounds displacements.
This is specified as a normalized value from 0.0 to 1.0. For example, .25 sets a transparency
value of 25%. The default is 1.0. Use this parameter if
mode
is set to
"color"
.
Example
The following constructor function creates a new instance of the filter:
myFilter = new flash.filters.DisplacementMapFilter (mapBitmap, mapPoint,
componentX, componentY, scale, [mode], [color], [alpha])
The following example instantiates a new
DisplacementMapFilter
with a radial gradient
bitmap and applies it to the text containing MovieClip object
txtBlock
.
Содержание FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Страница 1: ...ActionScript 2 0 Language Reference ...
Страница 1352: ...1352 ActionScript classes ...