skipallmighty / tweener

Automatically exported from code.google.com/p/tweener
1 stars 0 forks source link

use of onStart to set initial value of tweened property #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The current code do not allow the onStart to change the starting value of
the tweened property.

To allow code such as:
// move a movieclip, 
showUp = function() {
  <movieclip>._x=100;
  <movieclip>._visible=true;
};
<movieclip>._visible = false;

Tweener.addTween(<movieclip>, {_x:400, time:1, delay:4, onStart:showUp});

in tweenrer.as
Replace:
// First update
tProperty.valueStart = getPropertyValue (tScope, tProperty.name);       if (k ==
0 && tTweening.onStart != undefined) {
  try {
    tTweening.onStart.apply(tScope, tTweening.onStartParams);
  } catch(e:Error) {
    //trace(e);
  }
}

by:

// First update
if (k == 0 && tTweening.onStart != undefined) {
  try {
    tTweening.onStart.apply(tScope, tTweening.onStartParams);
  } catch(e:Error) {
    //trace(e);
  }
}
tProperty.valueStart = getPropertyValue (tScope, tProperty.name);

Original issue reported on code.google.com by gvanvrec...@gmail.com on 2 Mar 2007 at 6:24

GoogleCodeExporter commented 9 years ago
Thanks. It makes sense. I actually wondered whether it would work to set the 
property
beforehand on onStart, thinking it was a good option, but I always forgot to 
test or
look at the code to see if that was the case.

I'll add it on the next unstable commit (saturday).

Original comment by zisfor...@gmail.com on 3 Mar 2007 at 2:18

GoogleCodeExporter commented 9 years ago
Solved on 1.21.35+, will go up in a few hours.

Original comment by zisfor...@gmail.com on 3 Mar 2007 at 2:01