| Package | com.flashdynamix.motion |
| Class | public class Tweensy |
Tweensy.to(item, {x:50, y:100});
Tweensy.from(item, {x:200, y:150});
Tweensy.fromTo(item, {x:200, y:150}, {x:50, y:100});
See also
| Property | Defined by | ||
|---|---|---|---|
| hasTimelines : Boolean [static][read-only]
Whether the Tweensy Class has any TweensyTimeline animations.
| Tweensy | ||
| paused : Boolean [static][read-only]
Whether the Tweensy Class is currently paused.
| Tweensy | ||
| refreshType : String [static]
Sets the timing system currently in use by the Tweensy Class.
| Tweensy | ||
| secondsPerFrame : Number [static]
Defines how many seconds per frame are added to to each on an ENTER_FRAME when TweensyGroup Class's refreshType is of the Tweensy.FRAME mode.
This property and feature is intended as an alternative to the Tweensy.TIME (time based animation) mode which can result in jumpy effects. | Tweensy | ||
| snapToClosest : Boolean [static]
Whether the timelines contained within the TweensyGroup class will snap tweened properties to the closest whole number.
| Tweensy | ||
| timelines : int [static][read-only]
Total number of animations in progress for the Tweensy class.
| Tweensy | ||
| useSmartRotate : Boolean [static]
Whether the timelines contained within the TweensyGroup class will use smart rotation or not.
Using smart rotation will ensure that when tweening the 'rotation' property it will turn in the shortest rotation direction. This fixes what may otherwise appear as a visual glitch even though mathimatically it is correct. | Tweensy | ||
| Method | Defined by | ||
|---|---|---|---|
|
[static]
Adds a TweensyTimeline to the Tweensy class.
| Tweensy | ||
|
from(instance:Object, from:Object, duration:Number = 0.5, ease:Function = null, delayStart:Number = 0, update:Object = null, onComplete:Function = null, onCompleteParams:Array = null):TweensyTimeline
[static]
Adds a from based tween using the properties defined in the from Object.
| Tweensy | ||
|
fromTo(instance:Object, from:Object, to:Object, duration:Number = 0.5, ease:Function = null, delayStart:Number = 0, update:Object = null, onComplete:Function = null, onCompleteParams:Array = null):TweensyTimeline
[static]
Adds a from to based tween using the properties defined in the from and to Objects.
| Tweensy | ||
|
gc():void
[static]
Prepares the Tweensy Library for garbage collection by disposing its Object Pools and making it
no longer usable in the Flash application.
| Tweensy | ||
|
pause():void
[static]
Pauses all tweens which have been executed by the Tweensy Class.
| Tweensy | ||
|
remove(timeline:TweensyTimeline):void
[static]
Removes a TweensyTimeline from the Tweensy class.
| Tweensy | ||
|
resume():void
[static]
Resumes all tweens which have been executed by the Tweensy Class.
| Tweensy | ||
|
stop(instance:* = null, ... props):void
[static]
Allows for removing tweens which have been executed by the Tweensy Class.
| Tweensy | ||
|
stopAll():void
[static]
Stops all tweens which have been executed by the Tweensy Class.
| Tweensy | ||
|
to(instance:Object, to:Object, duration:Number = 0.5, ease:Function = null, delayStart:Number = 0, update:Object = null, onComplete:Function = null, onCompleteParams:Array = null):TweensyTimeline
[static]
Adds a to based tween using the properties defined in the target Object.
| Tweensy | ||
|
toString():String
| Tweensy | ||
|
updateTo(instance:Object, to:Object):void
[static]
Updates a tween for the instance Object to the new target positions defined in the to Object.
| Tweensy | ||
| Constant | Defined by | ||
|---|---|---|---|
| FRAME : String = "frame" [static]
Sets the refreshType to use the current seconds per frame on each ENTER_FRAME allowing for frame based animations.
| Tweensy | ||
| TIME : String = "time" [static]
Sets the refreshType to use the current frames per second of the SWF allowing for time based animations.
| Tweensy | ||
| version : Number = 0.2 [static]
| Tweensy | ||
| hasTimelines | property |
hasTimelines:Boolean [read-only]Whether the Tweensy Class has any TweensyTimeline animations.
Implementation public static function get hasTimelines():Boolean
| paused | property |
paused:Boolean [read-only]Whether the Tweensy Class is currently paused.
Implementation public static function get paused():Boolean
| refreshType | property |
refreshType:String [read-write]
Sets the timing system currently in use by the Tweensy Class.
public static function get refreshType():String
public function set refreshType(value:String):void
See also
| secondsPerFrame | property |
secondsPerFrame:Number [read-write]
Defines how many seconds per frame are added to to each on an ENTER_FRAME when TweensyGroup Class's refreshType is of the Tweensy.FRAME mode.
This property and feature is intended as an alternative to the Tweensy.TIME (time based animation) mode which can result in jumpy effects.
This is because by using Tweensy.Time rfreshType it ensures that your animation will accurately finish in the time you specify.
Instead Tweensy.FRAME ensures that every frame is rendered for the duration of your animation.
e.g. If your FLA frame rate is 30 frames per second then set secondsPerFrame to 1 second for every 30 frames (1/30).
public static function get secondsPerFrame():Number
public function set secondsPerFrame(value:Number):void
See also
| snapToClosest | property |
snapToClosest:Boolean [read-write]Whether the timelines contained within the TweensyGroup class will snap tweened properties to the closest whole number.
Implementation public static function get snapToClosest():Boolean
public function set snapToClosest(value:Boolean):void
| timelines | property |
timelines:int [read-only]Total number of animations in progress for the Tweensy class.
Implementation public static function get timelines():int
| useSmartRotate | property |
useSmartRotate:Boolean [read-write]
Whether the timelines contained within the TweensyGroup class will use smart rotation or not.
Using smart rotation will ensure that when tweening the 'rotation' property it will turn in the shortest rotation direction.
This fixes what may otherwise appear as a visual glitch even though mathimatically it is correct.
public static function get useSmartRotate():Boolean
public function set useSmartRotate(value:Boolean):void
| add | () | method |
public static function add(timeline:TweensyTimeline):TweensyTimelineAdds a TweensyTimeline to the Tweensy class. This can be useful if you want to prepare an animation and the items in it but not necessarily have it Tweening straight away.
Parameterstimeline:TweensyTimeline |
TweensyTimeline —
An instance to the TweensyTimeline.
|
| from | () | method |
public static function from(instance:Object, from:Object, duration:Number = 0.5, ease:Function = null, delayStart:Number = 0, update:Object = null, onComplete:Function = null, onCompleteParams:Array = null):TweensyTimelineAdds a from based tween using the properties defined in the from Object.
Parametersinstance:Object — The instance Object to be tweened or multiple instances if using the type Array e.g. [item1, item2]
|
|
from:Object — An Object containing the properties you would like to tween from e.g. {x:50, y:25}
or this can be relative e.g. {x:'50', y:'-25'} or can be a random position e.g. {x:'-50, 50', y:'-25, 25'}
|
|
duration:Number (default = 0.5) — The time in secs you would like the tween to run.
|
|
ease:Function (default = null) — The ease equation you would like to use, by default this is Quintic.easeOut or the ease equation defined in TweensyTimeline.defaultTween.
|
|
delayStart:Number (default = 0) — The delay you would like to use at the beginning of the tween and every subsequent REPLAY of a tween.
|
|
update:Object (default = null) — This param is used when tweening a property in a Object which needs to be applied onto another Object each time
the tween occurs.This occurs with tweening ColorTransforms, Matrices, SoundTransforms, BitmapFilters.For example Tweensy.from(new DropShadowFilter(), {alpha:0}, 0.5, null, 0, myDisplayItem);Will apply the tweening DropShadowFilter onto the DisplayObject 'myDisplayItem'.
|
|
onComplete:Function (default = null) — The onComplete event handler you would like to fire once the tween is complete.
|
|
onCompleteParams:Array (default = null) — The params applied to the onComplete handler.
|
TweensyTimeline —
An instance of the TweensyTimeline which can used to manage this tween.
|
See also
| fromTo | () | method |
public static function fromTo(instance:Object, from:Object, to:Object, duration:Number = 0.5, ease:Function = null, delayStart:Number = 0, update:Object = null, onComplete:Function = null, onCompleteParams:Array = null):TweensyTimelineAdds a from to based tween using the properties defined in the from and to Objects.
Parametersinstance:Object — The instance Object to be tweened or multiple instances if using the type Array e.g. [item1, item2]
|
|
from:Object — An Object containing the properties you would like to tween from e.g. {x:50, y:25}
or this can be relative e.g. {x:'50', y:'-25'} or can be a random position e.g. {x:'-50, 50', y:'-25, 25'}
|
|
to:Object — An Object containing the properties you would like to tween to e.g. {x:50, y:25}
or this can be relative e.g. {x:'50', y:'-25'} or can be a random position e.g. {x:'-50, 50', y:'-25, 25'}
|
|
duration:Number (default = 0.5) — The time in secs you would like the tween to run.
|
|
ease:Function (default = null) — The ease equation you would like to use, by default this is Quintic.easeOut or the ease equation defined in TweensyTimeline.defaultTween.
|
|
delayStart:Number (default = 0) — The delay you would like to use at the beginning of the tween and every subsequent REPLAY of a tween.
|
|
update:Object (default = null) — This param is used when tweening a property in a Object which needs to be applied onto another Object each time
the tween occurs.This occurs with tweening ColorTransforms, Matrices, SoundTransforms, BitmapFilters.For example Tweensy.fromTo(new DropShadowFilter(), {alpha:1}, {alpha:0}, 0.5, null, 0, myDisplayItem);Will apply the tweening DropShadowFilter onto the DisplayObject 'myDisplayItem'.
|
|
onComplete:Function (default = null) — The onComplete event handler you would like to fire once the tween is complete.
|
|
onCompleteParams:Array (default = null) — The params applied to the onComplete handler.
|
TweensyTimeline —
An instance of the TweensyTimeline which can used to manage this tween.
|
See also
| gc | () | method |
public static function gc():voidPrepares the Tweensy Library for garbage collection by disposing its Object Pools and making it no longer usable in the Flash application.
| pause | () | method |
public static function pause():voidPauses all tweens which have been executed by the Tweensy Class.
| remove | () | method |
public static function remove(timeline:TweensyTimeline):voidRemoves a TweensyTimeline from the Tweensy class. This will stop this timeline from being updated but can be re-added to the Tweensy class resuming that animation.
Parameterstimeline:TweensyTimeline |
| resume | () | method |
public static function resume():voidResumes all tweens which have been executed by the Tweensy Class.
| stop | () | method |
public static function stop(instance:* = null, ... props):void
Allows for removing tweens which have been executed by the Tweensy Class.
Tweens can be stopped via an instance or tween props by the following methods :
instance:* (default = null) |
|
... props |
| stopAll | () | method |
public static function stopAll():voidStops all tweens which have been executed by the Tweensy Class.
| to | () | method |
public static function to(instance:Object, to:Object, duration:Number = 0.5, ease:Function = null, delayStart:Number = 0, update:Object = null, onComplete:Function = null, onCompleteParams:Array = null):TweensyTimelineAdds a to based tween using the properties defined in the target Object.
Parametersinstance:Object — The instance Object to be tweened or multiple instances if using the type Array e.g. [item1, item2]
|
|
to:Object — An Object containing the properties you would like to tween to e.g. {x:50, y:25}
or this can be relative e.g. {x:'50', y:'-25'} or can be a random position e.g. {x:'-50, 50', y:'-25, 25'}
|
|
duration:Number (default = 0.5) — The time in secs you would like the tween to run.
|
|
ease:Function (default = null) — The ease equation you would like to use, by default this is Quintic.easeOut or the ease equation defined in TweensyTimeline.defaultTween.
|
|
delayStart:Number (default = 0) — The delay you would like to use at the beginning of the tween and every subsequent REPLAY of a tween.
|
|
update:Object (default = null) — This param is used when tweening a property in a Object which needs to be applied onto another Object each time
the tween occurs. This occurs with tweening ColorTransforms, Matrices, SoundTransforms, BitmapFilters.For example Tweensy.to(new DropShadowFilter(), {alpha:0}, 0.5, null, 0, myDisplayItem);Will apply the tweening DropShadowFilter onto the DisplayObject 'myDisplayItem'.
|
|
onComplete:Function (default = null) — The onComplete event handler you would like to fire once the tween is complete.
|
|
onCompleteParams:Array (default = null) — The params applied to the onComplete handler.
|
TweensyTimeline —
An instance to the TweensyTimeline which can used to manage this tween.
|
See also
| toString | () | method |
public function toString():String
Returns
String |
| updateTo | () | method |
public static function updateTo(instance:Object, to:Object):voidUpdates a tween for the instance Object to the new target positions defined in the to Object.
Parametersinstance:Object |
|
to:Object |
| FRAME | constant |
public static const FRAME:String = "frame"Sets the refreshType to use the current seconds per frame on each ENTER_FRAME allowing for frame based animations.
See also
| TIME | constant |
public static const TIME:String = "time"Sets the refreshType to use the current frames per second of the SWF allowing for time based animations.
See also
| version | constant |
public static const version:Number = 0.2