Tweeny
I am no longer using or maintaining Tweeny! It was interesting to develop and understanding of how a tween engine works, but I also have even more appreciation for the work that other people have done and the effort and time they have invested in creating robust and feature-rich tween engines. Which is why it makes sense to use something like TweenLite for my work as it already does everything I want to do, and it does it well.
Tweeny is a very minimal animation engine I will be slowly developing over time to help make life easier when creating AS3 projects similar to the ones I often find myself working on. These are usually smaller websites, portfolios, microsites, online adverts and websites where elegant and controlled animation is often used but without too many ‘bells and whistles’.
Tweeny is being hosted on my google code account and all the source code is in the repository along with other classes and items that I will be creating to simplify my workload.
Tweeny has 3 shortcut methods that let you create animations quickly and easily with 1 line of code and 3 properties. These methods are outlined below. You could also create a new instance of Tweeny if you really wanted but you would need to specify all 8 properties and handle the removal of the instance for Garbage Collection yourself.
Methods:
Tweeny.to(instance:DisplayObject, property:String, toTarget:Number, duration:Number, delay:Number, ease:Function, onComplete:Function, onCompleteParams:Array);
Tweeny.from(instance:Object, property:String, fromTarget:Number, duration:Number, delay:Number, ease:Function, onComplete:Function, onCompleteParams:Array);
Tweeny.fromTo(instance:Object, property:String, fromTarget:Number, toTarget:Number, duration:Number, delay:Number, ease:Function, onComplete:Function, onCompleteParams:Array);
Properties:
- instance: any DisplayObject ie Sprite, MovieClip, Shape, TextField
- property: a String of the property to animate, it can be:
- width
- height
- x
- y
- scaleX
- scaleY
- alpha
- fromTarget: the initial value of the property being animated
- toTarget: the final value of the property being animated
- duration: the length of the tween
- delay: the number of seconds to delay the start of the tween
- ease: the easing equation for the Tweeny instance
- onComplete: the function called once the tween in complete
- onCompleteParams: an Array of parameters passed to the onComplete function
Changes:
Tweeny 0.9
- pixelSnapping is now true by default for all tweens for the x, y, width and height properties
Tweeny 0.8
- Added a global COMPLETE event that is dispatched each time all active tweens are completed and tween is deactivating
- Fixed bug with multiple periods in version number
- Added toString() for all Tweeny instances which displays the targets instance name and the property being tweened
- Forces initial state of animation when a new Tweeny instance is first instantiated, regardless of any delay
- Added static pauseAllTweens() and resumeAllTweens()
Tweeny 0.7 (complete re-write)
- Tweeny no longer extends CoreTweeny and is stand alone
- Amount of code has been reduced and optimised
- Fixed ‘flickering’ bug which occured when a tween was overridden
- pixelSnapping is true by default (apart from an alpha tween) so all tweens snap to the nearest pixel
Tweeny 0.6
- cleaned code and added auto forcing of intial state and final rendering
Tweeny 0.5
- Added fix so the final property target is forced once the tween has finished, on heavy animation this was being skipped leaving unfinished animation
- added fix so the initial property is forced when a tween is instantiated (even if a delay is set)
- removed all event dispatches
- added validation for Tweeny properties
- added strongly typed variables to Tweeny
- added TweenySequence to create a complex sequence of individual tweens
- added play() method to start playing a tween if it is instantiated directly instead of using a shortcut method (to, from, fromTo)
- added MIT license and header to all classes
Tweeny 0.4
- Added TextTweeny for typewriter animations
- Added support for ease equations for each instance
- Force the fromTarget value on to the instance at the beginning of the tween, even if there is a delay
Tweeny 0.3
- Re-written engine, now uses a TweenyManager class to control all current Tweeny instances
- Re-written interface, you can create a Tweeny instance directly or use any of the 3 shortcut methods to, from and fromTo
- Re-written special properties, you can set the pixelSnapping property and delay of a tween using the specialProperties object parameter.
- The DisplayTweeny class now excepts the visible property as a string to animate. This is an alpha animation that toggles the visibility of the instance at the beginning and end.
Note: Versions 0.1 and 0.2 of Tweeny are now obsolete thanks to version 0.3.