I’m making great progress on my animation project, but find that I keep reaching for a few additional properties that I’ve grown used to with TweenMax. While I think the Transitions API should mirror most of these, (http://www.greensock.com/tweenmax/) my top 5 - in order of precedence - are described below and translated from the AS3 syntax used by greensock as an example.
1.) startAt:Table
This allows you to define the starting values for each property. Typically, transition uses the current value (whatever it happens to be at the time the transition begins) as the start value, but startAt allows you to override that behavior. Simply pass a table in with whatever properties you’d like to set just before the tween begins.
For example, if “image.x” is currently 100, and you’d like to transition it from 0 to 500, do
[blockcode]transition.to (image, {time=1, x=500, startAt={x:0})[/blockcode]
2.) repeat : number Number of times that the transition should repeat. To repeat indefinitely, use -1 and repeatDelay : number Amount of time in milliseconds between repeats.
[blockcode]transition.to (blinkingimage, {time=100, alpha=0, repeat=-1, repeatDelay=1500)[/blockcode]
3.) yoyo : boolean Works in conjunction with the repeat property, determining the behavior of each cycle. When yoyo is true, the transition will go back and forth, appearing to reverse every other cycle. So if repeat is 2 and yoyo is false, it will look like: start - 1 - 2 - 3 - 1 - 2 - 3 - 1 - 2 - 3 - end. But if repeat is 2 and yoyo is true, it will look like: start - 1 - 2 - 3 - 3 - 2 - 1 - 1 - 2 - 3 - end.
4.) onInit : Function and a optional onInitParams : Table An Array of parameters to pass the onInit function.
Similar to the existing onComplete , this is a function that should be called just before the transition initalizes (renders for the first time). Since onInit runs before the start/end values are recorded internally, it is a good place to run code that affects the target’s initial position or other transition-related properties. onStart, by contrast, runs AFTER the transition inits and the start/end values are recorded internally. onStart is called every time the transition begins which can happen more than once if the transition is restarted multiple times.
5.) onStart : Function and an optional onStartParams : Table An Array of parameters to pass the onStart function.
This is a function that should be called when the transition begins (when its currentTime is at 0 and changes to some other value which can happen more than once if the transition is restarted multiple times).
I realize you don’t “need” any more work between now and getting the SDK released, but wanted to share the feedback and insights from my current efforts.
-Andy [import]uid: 5339 topic_id: 1965 reply_id: 301965[/import]