Packagemx.effects.effectClasses
Classpublic class MaskEffectInstance
InheritanceMaskEffectInstance Inheritance EffectInstance Inheritance flash.events.EventDispatcher
SubclassesIrisInstance, WipeDownInstance, WipeLeftInstance, WipeRightInstance, WipeUpInstance

The MaskEffectInstance class is an abstract base class that implements the instance class for the MaskEffect class.

Every effect class that is a subclass of the TweenEffect class supports the following events:

The event object passed to the event listener for these events is of type TweenEvent. The TweenEvent class defines the property value, which contains the tween value calculated by the effect. For the Mask effect, the TweenEvent.value property contains a 4-item Array, where:

See also

mx.effects.MaskEffect
mx.events.TweenEvent


Public Properties
 PropertyDefined by
 InheritedclassName : String
The name of the effect class, such as "FadeInstance".
EffectInstance
  createMaskFunction : Function
Function called when the effect creates the mask.
MaskEffectInstance
 Inheritedduration : Number
The duration of the effect, in milliseconds.
EffectInstance
 Inheritedeffect : IEffect
The IEffect object that created this IEffectInstance object.
EffectInstance
 InheritedeffectTargetHost : IEffectTargetHost
A property that lets you access the target list-based control of a data effect.
EffectInstance
 InheritedhideFocusRing : Boolean
Determines whether the effect should hide the focus ring when starting the effect.
EffectInstance
  moveEasingFunction : Function
Easing function to use for moving the mask.
MaskEffectInstance
 InheritedplayheadTime : Number
Current position in time of the effect.
EffectInstance
 InheritedpropertyChanges : PropertyChanges
Specifies the PropertyChanges object containing the start and end values for the set of properties relevant to the effect's targets.
EffectInstance
 InheritedrepeatCount : int
Number of times to repeat the effect.
EffectInstance
 InheritedrepeatDelay : int
Amount of time, in milliseconds, to wait before repeating the effect.
EffectInstance
  scaleEasingFunction : Function
Easing function to use for scaling the mask.
MaskEffectInstance
  scaleXFrom : Number
Initial scaleX for mask.
MaskEffectInstance
  scaleXTo : Number
Ending scaleX for mask.
MaskEffectInstance
  scaleYFrom : Number
Initial scaleY for mask.
MaskEffectInstance
  scaleYTo : Number
Ending scaleY for mask.
MaskEffectInstance
  showTarget : Boolean
Specifies that the target component is becoming visible, false, or invisible, true.
MaskEffectInstance
 InheritedstartDelay : int
Amount of time, in milliseconds, to wait before starting the effect.
EffectInstance
 InheritedsuspendBackgroundProcessing : Boolean
If true, blocks all background processing while the effect is playing.
EffectInstance
 Inheritedtarget : Object
The UIComponent object to which this effect is applied.
EffectInstance
  targetArea : Rectangle
The area where the mask is applied on the target.
MaskEffectInstance
 InheritedtriggerEvent : Event
The event, if any, which triggered the playing of the effect.
EffectInstance
  xFrom : Number
Initial position's x coordinate for mask.
MaskEffectInstance
  xTo : Number
Destination position's x coordinate for mask.
MaskEffectInstance
  yFrom : Number
Initial position's y coordinate for mask.
MaskEffectInstance
  yTo : Number
Destination position's y coordinate for mask.
MaskEffectInstance
Protected Properties
 PropertyDefined by
  effectMask : Shape
Contains the effect mask, either the default mask created by the defaultCreateMask() method, or the one specified by the function passed to the createMaskFunction property.
MaskEffectInstance
  targetVisualBounds : Rectangle
The actual size of the effect target, including any drop shadows.
MaskEffectInstance
Public Methods
 MethodDefined by
  
MaskEffectInstance(target:Object)
Constructor.
MaskEffectInstance
 Inherited
end():void
Interrupts an effect instance that is currently playing, and jumps immediately to the end of the effect.
EffectInstance
 Inherited
finishEffect():void
Called by the end() method when the effect finishes playing.
EffectInstance
 Inherited
finishRepeat():void
Called after each iteration of a repeated effect finishes playing.
EffectInstance
 Inherited
initEffect(event:Event):void
This method is called if the effect was triggered by the EffectManager.
EffectInstance
  
pause():void
Pauses the effect until you call the resume() method.
MaskEffectInstance
 Inherited
play():void
Plays the effect instance on the target.
EffectInstance
  
resume():void
Resumes the effect after it has been paused by a call to the pause() method.
MaskEffectInstance
  
reverse():void
Plays the effect in reverse, starting from the current position of the effect.
MaskEffectInstance
 Inherited
startEffect():void
Plays the effect instance on the target after the startDelay period has elapsed.
EffectInstance
 Inherited
stop():void
Stops the effect, leaving the target in its current state.
EffectInstance
Protected Methods
 MethodDefined by
  
defaultCreateMask(targ:Object, bounds:Rectangle):Shape
Creates the default mask for the effect.
MaskEffectInstance
  
Initializes the move and scale properties of the effect.
MaskEffectInstance
  
onMoveTweenEnd(value:Object):void
Callback method that is called when the x and y position of the mask should be updated by the effect for the last time.
MaskEffectInstance
  
onMoveTweenUpdate(value:Object):void
Callback method that is called when the x and y position of the mask should be updated by the effect.
MaskEffectInstance
  
onScaleTweenEnd(value:Object):void
Callback method that is called when the scaleX and scaleY properties of the mask should be updated by the effect for the last time.
MaskEffectInstance
  
onScaleTweenUpdate(value:Object):void
Callback method that is called when the scaleX and scaleY properties of the mask should be updated by the effect.
MaskEffectInstance
Property detail
createMaskFunctionproperty
createMaskFunction:Function  [read-write]

Function called when the effect creates the mask. The default value is a function that returns a Rectangle with the same dimensions as the effect target.

You can use this property to specify your own callback function to draw the mask. The function must have the following signature:

   public function createLargeMask(targ:Object, bounds:Rectangle):Shape {
     var myMask:Shape = new Shape();
     // Create mask.
   
     return myMask;
   }
   

You set this property to the name of the function, as the following example shows for the WipeLeft effect:

     <mx:WipeLeft id="showWL" createMaskFunction="createLargeMask" showTarget="false"/>
Implementation
    public function get createMaskFunction():Function
    public function set createMaskFunction(value:Function):void
effectMaskproperty 
protected var effectMask:Shape

Contains the effect mask, either the default mask created by the defaultCreateMask() method, or the one specified by the function passed to the createMaskFunction property.

moveEasingFunctionproperty 
public var moveEasingFunction:Function

Easing function to use for moving the mask.

scaleEasingFunctionproperty 
public var scaleEasingFunction:Function

Easing function to use for scaling the mask.

scaleXFromproperty 
public var scaleXFrom:Number

Initial scaleX for mask.

scaleXToproperty 
public var scaleXTo:Number

Ending scaleX for mask.

scaleYFromproperty 
public var scaleYFrom:Number

Initial scaleY for mask.

scaleYToproperty 
public var scaleYTo:Number

Ending scaleY for mask.

showTargetproperty 
showTarget:Boolean  [read-write]

Specifies that the target component is becoming visible, false, or invisible, true.

The default value is true.

Implementation
    public function get showTarget():Boolean
    public function set showTarget(value:Boolean):void
targetAreaproperty 
public var targetArea:Rectangle

The area where the mask is applied on the target. The dimensions are relative to the target itself. By default, the area is the entire target and is created like this: new Rectangle(0, 0, target.width, target.height);

targetVisualBoundsproperty 
protected var targetVisualBounds:Rectangle

The actual size of the effect target, including any drop shadows. Flex calculates the value of this property; you do not have to set it.

xFromproperty 
public var xFrom:Number

Initial position's x coordinate for mask.

xToproperty 
public var xTo:Number

Destination position's x coordinate for mask.

yFromproperty 
public var yFrom:Number

Initial position's y coordinate for mask.

yToproperty 
public var yTo:Number

Destination position's y coordinate for mask.

Constructor detail
MaskEffectInstance()constructor
public function MaskEffectInstance(target:Object)

Constructor.

Parameters
target:Object — The Object to animate with this effect.
Method detail
defaultCreateMask()method
protected function defaultCreateMask(targ:Object, bounds:Rectangle):Shape

Creates the default mask for the effect.

Parameters
targ:Object — The effect target.
 
bounds:Rectangle — The actual visual bounds of the target which includes drop shadows

Returns
Shape — A Shape object that defines the mask.
initMaskEffect()method 
protected function initMaskEffect():void

Initializes the move and scale properties of the effect. All subclasses should override this function. Flex calls it after the mask has been created, but before the tweens are created.

onMoveTweenEnd()method 
protected function onMoveTweenEnd(value:Object):void

Callback method that is called when the x and y position of the mask should be updated by the effect for the last time. You do not call this method directly. This method implements the method of the superclass.

Parameters
value:Object — Contains the final x and y value for the mask position, where value[0] contains the x position of the mask, and value[1] contains the y position.
onMoveTweenUpdate()method 
protected function onMoveTweenUpdate(value:Object):void

Callback method that is called when the x and y position of the mask should be updated by the effect. You do not call this method directly. This method implements the method of the superclass.

Parameters
value:Object — Contains an interpolated x and y value for the mask position, where value[0] contains the new x position of the mask, and value[1] contains the new y position.
onScaleTweenEnd()method 
protected function onScaleTweenEnd(value:Object):void

Callback method that is called when the scaleX and scaleY properties of the mask should be updated by the effect for the last time. You do not call this method directly. This method implements the method of the superclass.

Parameters
value:Object — Contains the final scaleX and scaleY value for the mask, where value[0] contains the scaleX value of the mask, and value[1] contains the scaleY value.
onScaleTweenUpdate()method 
protected function onScaleTweenUpdate(value:Object):void

Callback method that is called when the scaleX and scaleY properties of the mask should be updated by the effect. You do not call this method directly. This method implements the method of the superclass.

Parameters
value:Object — Contains an interpolated scaleX and scaleY value for the mask, where value[0] contains the new scaleX value of the mask, and value[1] contains the new scaleY value.
pause()method 
public override function pause():void

Pauses the effect until you call the resume() method.

resume()method 
public override function resume():void

Resumes the effect after it has been paused by a call to the pause() method.

reverse()method 
public override function reverse():void

Plays the effect in reverse, starting from the current position of the effect.