Packagefeathers.motion.effectClasses
Classpublic class BaseEffectContext
InheritanceBaseEffectContext Inheritance starling.events.EventDispatcher
Implements IEffectContext
Subclasses ParallelEffectContext, SequenceEffectContext, TweenEffectContext

An abstract base class for IEffectContext implementations.

See also

Effects and animation for Feathers components


Public Properties
 PropertyDefined By
  duration : Number
[read-only] The duration of the effect, in seconds.
BaseEffectContext
  juggler : Juggler
The Juggler used to update the effect when it is playing.
BaseEffectContext
  position : Number
Sets the position of the effect using a value between 0 and 1.
BaseEffectContext
  target : DisplayObject
[read-only] The target of the effect.
BaseEffectContext
  transition : Object
[read-only] The transition, or easing function, used for the effect.
BaseEffectContext
Public Methods
 MethodDefined By
  
BaseEffectContext(target:DisplayObject, duration:Number, transition:Object = null)
Constructor.
BaseEffectContext
  
interrupt():void
Interrupts the playing effect, but the effect context will be allowed to determine on its own if it should call stop() or toEnd().
BaseEffectContext
  
pause():void
Pauses an effect that is currently playing.
BaseEffectContext
  
play():void
Starts playing the effect from its current position to the end.
BaseEffectContext
  
Starts playing the effect from its current position back to the beginning (completing at a position of 0).
BaseEffectContext
  
stop():void
Stops the effect at its current position and forces Event.COMPLETE to dispatch.
BaseEffectContext
  
toEnd():void
Advances the effect to the end and forces Event.COMPLETE to dispatch.
BaseEffectContext
Protected Methods
 MethodDefined By
  
Called when the effect completes or is interrupted.
BaseEffectContext
  
Called when the effect is initialized.
BaseEffectContext
  
Called when the effect's position is updated.
BaseEffectContext
Events
 Event Summary Defined By
  Dispatched when the effect completes or is interrupted.BaseEffectContext
Property Detail
durationproperty
duration:Number  [read-only]

The duration of the effect, in seconds.


Implementation
    public function get duration():Number
jugglerproperty 
juggler:Juggler

The Juggler used to update the effect when it is playing. If null, uses Starling.juggler.


Implementation
    public function get juggler():Juggler
    public function set juggler(value:Juggler):void

See also

positionproperty 
position:Number

Sets the position of the effect using a value between 0 and 1.


Implementation
    public function get position():Number
    public function set position(value:Number):void

See also

targetproperty 
target:DisplayObject  [read-only]

The target of the effect.


Implementation
    public function get target():DisplayObject
transitionproperty 
transition:Object  [read-only]

The transition, or easing function, used for the effect.


Implementation
    public function get transition():Object

See also

Constructor Detail
BaseEffectContext()Constructor
public function BaseEffectContext(target:DisplayObject, duration:Number, transition:Object = null)

Constructor.

Parameters
target:DisplayObject
 
duration:Number
 
transition:Object (default = null)
Method Detail
cleanupEffect()method
protected function cleanupEffect():void

Called when the effect completes or is interrupted. Subclasses may override this method to customize the effect's behavior.

interrupt()method 
public function interrupt():void

Interrupts the playing effect, but the effect context will be allowed to determine on its own if it should call stop() or toEnd().

pause()method 
public function pause():void

Pauses an effect that is currently playing.

play()method 
public function play():void

Starts playing the effect from its current position to the end.

playReverse()method 
public function playReverse():void

Starts playing the effect from its current position back to the beginning (completing at a position of 0).

prepareEffect()method 
protected function prepareEffect():void

Called when the effect is initialized. Subclasses may override this method to customize the effect's behavior.

stop()method 
public function stop():void

Stops the effect at its current position and forces Event.COMPLETE to dispatch. The data property of the event will be true.

toEnd()method 
public function toEnd():void

Advances the effect to the end and forces Event.COMPLETE to dispatch. The data property of the event will be false.

updateEffect()method 
protected function updateEffect():void

Called when the effect's position is updated. Subclasses may override this method to customize the effect's behavior.

Event Detail
complete Event
Event Object Type: starling.events.Event
Event.type property = starling.events.Event.COMPLETE

Dispatched when the effect completes or is interrupted. If the effect was stopped instead of advancing to the end, the value of the event's data property will be true.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
dataIf the effect was stopped without reaching the end, this value will be true. Otherwise, false.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.

See also