Package | feathers.motion.effectClasses |
Class | public class BaseEffectContext |
Inheritance | BaseEffectContext starling.events.EventDispatcher |
Implements | IEffectContext |
Subclasses | ParallelEffectContext, SequenceEffectContext, TweenEffectContext |
IEffectContext
implementations.
See also
Property | Defined 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 |
Method | Defined 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 | ||
playReverse():void
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 |
Method | Defined By | ||
---|---|---|---|
cleanupEffect():void
Called when the effect completes or is interrupted. | BaseEffectContext | ||
prepareEffect():void
Called when the effect is initialized. | BaseEffectContext | ||
updateEffect():void
Called when the effect's position is updated. | BaseEffectContext |
Event | Summary | Defined By | ||
---|---|---|---|---|
Dispatched when the effect completes or is interrupted. | BaseEffectContext |
duration | property |
duration:Number
[read-only] The duration of the effect, in seconds.
public function get duration():Number
juggler | property |
juggler:Juggler
The Juggler
used to update the effect when it is
playing. If null
, uses Starling.juggler
.
public function get juggler():Juggler
public function set juggler(value:Juggler):void
See also
position | property |
position:Number
Sets the position of the effect using a value between 0
and 1
.
public function get position():Number
public function set position(value:Number):void
See also
target | property |
target:DisplayObject
[read-only] The target of the effect.
public function get target():DisplayObject
transition | property |
transition:Object
[read-only] The transition, or easing function, used for the effect.
public function get transition():Object
See also
BaseEffectContext | () | Constructor |
public function BaseEffectContext(target:DisplayObject, duration:Number, transition:Object = null)
Constructor.
Parameterstarget:DisplayObject | |
duration:Number | |
transition:Object (default = null )
|
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.
complete | Event |
starling.events.Event
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:
Property | Value |
---|---|
bubbles | false |
currentTarget | The 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 . |
data | If the effect was stopped without
reaching the end, this value will be true . Otherwise,
false . |
target | The 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