31-08-2008, 02:09 PM
Good morning,
this demo plays around with a modification of the Tween class of the flare library which allows to change and add target values of running tweens.
By clicking on the left node which is traversing over the display in this demo the following changes of the running tween are triggered:
In order to run this demo you would have to temporary replace the Tween class of the flare lib with the attached modified version of this class.
This demo was stimulated by an explanation by Jeff on this issue in the flare forum
http://sourceforge.net/forum/forum.php?t..._id=757572
Rather than back interpolating as suggested I try to achieve the same result by using the current value as the start value of the new Interpolator and correcting the tween fraction values for the modified target values instead. The lazy guy advantage of this approach seems to be that no back interpolating methods have to implemented for the different Interpolator classes. Nevertheless there is a little calculation overhead drawback. I guess the most reasonable way would be that each Interpolator class extension has its own back interpolating method but for now I shy away from modifying to many flare classes in my projects and in addition can't get my head around how to back interpolate colors.
See the first reply for the new modified Tween class
Feedback of course most welcome.
martin
this demo in action
ps A great tween lib with a lot of inspiring features:
http://blog.greensock.com/tweenliteas3/
this demo plays around with a modification of the Tween class of the flare library which allows to change and add target values of running tweens.
By clicking on the left node which is traversing over the display in this demo the following changes of the running tween are triggered:
- The x target value is changed from 300 to 100.
- The tweening of the lineColor value is stopped. This is achieved through setting the target value to the current value.
- A new tweening of the fillColor from gray to red is added.
- The y target value of 300 stays unmodified.
In order to run this demo you would have to temporary replace the Tween class of the flare lib with the attached modified version of this class.
This demo was stimulated by an explanation by Jeff on this issue in the flare forum
http://sourceforge.net/forum/forum.php?t..._id=757572
Rather than back interpolating as suggested I try to achieve the same result by using the current value as the start value of the new Interpolator and correcting the tween fraction values for the modified target values instead. The lazy guy advantage of this approach seems to be that no back interpolating methods have to implemented for the different Interpolator classes. Nevertheless there is a little calculation overhead drawback. I guess the most reasonable way would be that each Interpolator class extension has its own back interpolating method but for now I shy away from modifying to many flare classes in my projects and in addition can't get my head around how to back interpolate colors.
See the first reply for the new modified Tween class
Feedback of course most welcome.
martin
this demo in action
ps A great tween lib with a lot of inspiring features:
http://blog.greensock.com/tweenliteas3/