Packagecom.flashdynamix.motion.effects.core
Classpublic class DisplacementEffect
InheritanceDisplacementEffect Inheritance FilterEffect Inheritance flash.utils.Proxy
ImplementsIEffect
SubclassesBulgeEffect, BumpMapEffect, PerlinDisplacementEffect

Applies a DisplacementMapFilter to a BitmapData



Public Properties
 PropertyDefined by
 Inheritedfilter : BitmapFilter
The BitmapFilter to apply onto the BitmapData.
FilterEffect
  mapBmd : BitmapData
The displacement BitmapData to be used.
DisplacementEffect
  mapPoint : Point
The position of the displacement mapBmd.
DisplacementEffect
 Inheritedpt : Point
The Point from which to apply the BitmapFilter
FilterEffect
Public Methods
 MethodDefined by
  
DisplacementEffect(mapBmd:BitmapData, scaleX:Number = 3, scaleY:Number = 3, componentX:uint = 1, componentY:uint = 1, mode:String = "clamp", mapPoint:Point = null, color:uint = 0, alpha:uint = 0)
DisplacementEffect
  
render(bmd:BitmapData):void
Renders the DisplacementEffect on to the specified BitmapData
DisplacementEffect
Protected Methods
 MethodDefined by
 Inherited
getProperty(name:*):*
FilterEffect
 Inherited
setProperty(name:*, value:*):void
FilterEffect
Property detail
mapBmdproperty
public var mapBmd:BitmapData

The displacement BitmapData to be used.

mapPointproperty 
public var mapPoint:Point

The position of the displacement mapBmd.

Constructor detail
DisplacementEffect()constructor
public function DisplacementEffect(mapBmd:BitmapData, scaleX:Number = 3, scaleY:Number = 3, componentX:uint = 1, componentY:uint = 1, mode:String = "clamp", mapPoint:Point = null, color:uint = 0, alpha:uint = 0)

Parameters
mapBmd:BitmapData — The displacement BitmapData to be used.
 
scaleX:Number (default = 3) — The multiplier to use to scale the x displacement result from the map calculation.
 
scaleY:Number (default = 3) — The multiplier to use to scale the y displacement result from the map calculation.
 
componentX:uint (default = 1) — Describes which color channel to use in the map image to displace the x result.
Possible values are BitmapDataChannel constants:
  • BitmapDataChannel.ALPHA
  • BitmapDataChannel.BLUE
  • BitmapDataChannel.GREEN
  • BitmapDataChannel.RED
 
componentY:uint (default = 1) — Describes which color channel to use in the map image to displace the y result.
Possible values are BitmapDataChannel constants:
  • BitmapDataChannel.ALPHA
  • BitmapDataChannel.BLUE
  • BitmapDataChannel.GREEN
  • BitmapDataChannel.RED
 
mode:String (default = "clamp") — The mode for the filter.
Possible values are DisplacementMapFilterMode constants:
  • DisplacementMapFilterMode.WRAP — Wraps the displacement value to the other side of the source image.
  • DisplacementMapFilterMode.CLAMP — Clamps the displacement value to the edge of the source image.
  • DisplacementMapFilterMode.IGNORE — If the displacement value is out of range, ignores the displacement and uses the source pixel.
  • DisplacementMapFilterMode.COLOR — If the displacement value is outside the image, substitutes the values in the color and alpha properties.
 
mapPoint:Point (default = null) — A value that contains the offset of the upper-left corner of the target display object from the upper-left corner of the map image.
 
color:uint (default = 0) — Specifies what color to use for out-of-bounds displacements.
Values are in hexadecimal format. The default value for color is 0.
Use this property if the mode property is set to DisplacementMapFilterMode.COLOR.
 
alpha:uint (default = 0) — Specifies the alpha transparency value to use for out-of-bounds displacements.
It is specified as a normalized value from 0.0 to 1.0. For example, .25 sets a transparency value of 25%.
The default value is 0. Use this property if the mode property is set to DisplacementMapFilterMode.COLOR.
Method detail
render()method
public override function render(bmd:BitmapData):void

Renders the DisplacementEffect on to the specified BitmapData

Parameters
bmd:BitmapData