Packagefeathers.motion.effectClasses
Interfacepublic interface IEffectContext extends IFeathersEventDispatcher
Implementors BaseEffectContext, ParallelEffectContext, SequenceEffectContext, TweenEffectContext

Product Version : Feathers 3.5.0

Gives a component the ability to control an effect.

See also

Effects and animation for Feathers components


Public Properties
 PropertyDefined By
  duration : Number
[read-only] The duration of the effect, in seconds.
IEffectContext
  position : Number
The position of the effect, from 0 to 1.
IEffectContext
  target : DisplayObject
[read-only] The target of the effect.
IEffectContext
Public Methods
 MethodDefined By
 Inherited
addEventListener(type:String, listener:Function):void
Adds a listener for an event type.
IFeathersEventDispatcher
 Inherited
dispatchEvent(event:Event):void
Dispatches an event to all listeners added for the specified event type.
IFeathersEventDispatcher
 Inherited
dispatchEventWith(type:String, bubbles:Boolean = false, data:Object = null):void
Dispatches an event from the pool with the specified to all listeners for the specified event type.
IFeathersEventDispatcher
 Inherited
hasEventListener(type:String, listener:Function = null):Boolean
Checks if a listener has been added for the specified event type.
IFeathersEventDispatcher
  
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().
IEffectContext
  
pause():void
Pauses an effect that is currently playing.
IEffectContext
  
play():void
Starts playing the effect from its current position to the end.
IEffectContext
  
Starts playing the effect from its current position back to the beginning (completing at a position of 0).
IEffectContext
 Inherited
removeEventListener(type:String, listener:Function):void
Removes a listener for an event type.
IFeathersEventDispatcher
 Inherited
removeEventListeners(type:String = null):void
Removes all listeners for an event type.
IFeathersEventDispatcher
  
stop():void
Stops the effect at its current position and forces Event.COMPLETE to dispatch.
IEffectContext
  
toEnd():void
Advances the effect to the end and forces Event.COMPLETE to dispatch.
IEffectContext
Events
 Event Summary Defined By
  Dispatched when the effect completes or is interrupted.IEffectContext
Property Detail
durationproperty
duration:Number  [read-only]

The duration of the effect, in seconds.


Implementation
    public function get duration():Number
positionproperty 
position:Number

The position of the effect, from 0 to 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
Method Detail
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().

See also

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.

See also

playReverse()method 
public function playReverse():void

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

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.

See also

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.

See also

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.