GTween beta 5 Released! Major rewrite.

I’ve just released GTween beta 5. As I previously mentioned, this release is a significant rewrite to the full tweening engine. It stabilizes much of the positioning logic, and makes it more predictable. It also involved some very significant changes to the API, and the introduction of two important new classes: GTweenTimeline, and GTweeny.

GTween specific enhancements include a reduction in size to 4.5kb, a more predictable positioning model, slightly enhanced performance, the ability to specify repeat counts, full read/write access to start and end property values, the ability to lock starting properties, and a clean up of the API and code.

To read more about GTween, check out some demos, or download the library, visit gskinner.com/libraries/gtween/. To get more information on what’s changed, check out the version history or the API documentation.

This was a major rewrite, which pretty much guarantees that it has introduced new bugs. Please feel free to provide bug reports and feedback in the comments below. I’m hoping the next release will be final, once this version has seen some testing, bug fixing, and revisions based on feedback.

Here’s a super simple demo, showing GTween’s ability to deal with interrupted tweens. When you click around, it simply sets new end properties on each tween, and the tween adapts to the new values (and hey, it looks kind of cool). Check out the home page for more complex demos.

I’ll post about GTweenTimeline and GTweeny separately.

Grant Skinner

The "g" in gskinner. Also the "skinner".

@gskinner

66 Comments

  1. HOORAY!!! I’ve been refreshing this page every 10 minutes all day! I’m so pumped about this release! Thanks so much Grant for doing such amazing work!

  2. Thank you Grant. Excellent work that is much appreciated by the community. But you knew this.

  3. Hi Grant,

    I think I have found a bug, feel free to tell me different.

    Here is some code with comments to toss into a file and watch:

    import com.gskinner.motion.GTween;

    import fl.motion.easing.*;

    import flash.display.Sprite;

    import flash.display.StageScaleMode;

    var s:Sprite;

    stage.scaleMode = StageScaleMode.NO_SCALE;

    s = new Sprite();

    s.graphics.beginFill(0x000000,.5);

    s.graphics.drawRect(0,0,100,100);

    addChild(s);

    s.x = 200;

    s.y = 100;

    var t2:GTween = new GTween(s, 1, null, {delay:5, ease:Cubic.easeOut});

    var t3:GTween = new GTween(s, 1.5, null, {reflect:true, repeat:-1, ease:Cubic.easeInOut});

    t2.proxy.rotation = 50;

    //If this is on, after the box rotates, the height is affected

    //t3.proxy.width = 300;

    //if this is on, all is well after rotation

    //t3.proxy.scaleX = 3;

  4. Adam – This actually has to do with how Flash deals with those properties. It’s actually quite bizarre: width and height are set without consideration for rotation, however they are returned calculated with rotation. You can see this behaviour in the following code:

    trace(s.width); // 100

    s.rotation = 45;

    trace(s.width); // 141.4 rotated width

    s.width = 200; // visually only affects unrotated width

    trace(s.width); // 170.7 rotated width

    This is in contrast to scaleX and scaleY, which are unaffected by rotation.

  5. this is good news! any svn repo for this?

  6. Amazing Grant! I’ve been using GTween in a couple of projects already. Really good stuff. splines/catmull rom anytime soon? 😀

  7. Hi Grant,

    I really enjoy reading through your API’s. I definitely look forward to using your engine on a real project when it comes out of beta. The only thing that looked a bit odd to me, was using an array to add multiple tweens in the gTweenTimeline class. I’m not even saying its the wrong way, just seemed like a possibility for human error.

    Also I was wondering if there was a way, or even a need, to make pass a label as the start position for a tween. ie. addTween(labelNameOrStartPosition:*, tween:GTween):void. This could be cool because altering the label would move whatever tweens were using the label as their start position as well.

    THANKS again!!!

  8. Thanks Grant for responding to the width issue. I don’t know why I never noticed that! I’m a little bit speechless. I guess I can always do a little math and just use the scaleX and Y properties, or if I am drawing to the graphics object, I can just redraw.

    Thanks for the wonderful tween engine, I love the proxy!

    -Adam

  9. thanks!

    now I have enough of a reason to test this out instead of TweenMax. 😀

    Virtual Timeline, sounds really useful!

  10. Maybe I’m being dumb, but my callbacks are all being added at the end of the timeline for some reason.

    var timePos = 0;

    var timeline:GTweenTimeline = new GTweenTimeline();

    for(var i=0; i

  11. Hey Grant!

    I am also having a problem using addCallback();

    The callback function is being called at BOTH the position I added it to in the timeline and at the end of the timeline, specifically after Event.COMPLETE is dispatched by the timeline.

    Here is example source and output:

    import fl.motion.easing.*;

    import com.gskinner.motion.GTween;

    import com.gskinner.motion.GTweenTimeline;

    var tweenTimeline:GTweenTimeline = new GTweenTimeline();

    var tween:GTween = new GTween(box_mc, 1, {rotationX:360, rotationY:360});

    tweenTimeline.addTween(0, tween);

    tweenTimeline.addCallback(.5, tweenTimelineCallback);

    tweenTimeline.calculateDuration();

    tweenTimeline.addEventListener(Event.CHANGE, tweenTimelineHandler);

    tweenTimeline.addEventListener(Event.COMPLETE, tweenTimelineHandler);

    tweenTimeline.addEventListener(Event.INIT, tweenTimelineHandler);

    function tweenTimelineCallback():void{

    trace(“tweenTimelineCallback()”);

    }

    function tweenTimelineHandler(event:Event):void{

    //trace(“tweenTimelineHandler()”);

    trace(“event.type: ” + event.type);

    }

    The above source outputs:

    event.type: change

    event.type: init

    event.type: change

    event.type: change

    event.type: change

    event.type: change

    event.type: change

    tweenTimelineCallback()

    event.type: change

    event.type: change

    event.type: change

    event.type: change

    event.type: change

    event.type: change

    event.type: change

    event.type: change

    event.type: change

    event.type: change

    event.type: change

    event.type: change

    event.type: change

    event.type: change

    event.type: change

    event.type: complete

    tweenTimelineCallback()

    Any thoughts?

    Thanks for everything GTween is awesome!

    -Brody

  12. Seems to have some issues when using autoVisible. When I fade an image from alpha 1 to 0 and back from 0 to 1, everything seems to work fine. The problem comes with textfields (I actually have a textfield within a sprite and fading the sprite).

    When fading a sprite with an input textfield from 1 to 0, it just jumps to visibility false when the alpha hits 0 but does not change the alpha in between. When fading the sprite back, the input text field stays hidden. This problem seems to be sporadic at times, sometimes it will become visible, sometimes it will not.

    Thanks,

    -G

  13. Giraldo – You must embed your fonts to be able to alpha fade a text field. Let me know if that doesn’t help.

  14. Not sure if this blog is the place to post bugs, if not, please let me know…

    Found a problem when changing the timingMode on the GTweenTimeline. Using the code (the paper object contains a Papervision Plane):

    var tween:GTween;

    var timeline:GTweenTimeline = new GTweenTimeline(null, 0, null, {timingMode:GTween.TIME});

    timeline.addEventListener(Event.COMPLETE, onPeopleComplete);

    tween = new GTween(paper[‘person1’], 1, {x:0, y:50, z:25}, {ease:Sine.easeInOut});

    timeline.addTween(0, tween);

    tween = new GTween(paper[‘person1’], 1, {x:-50, y:0, z:0}, {ease:Sine.easeInOut});

    timeline.addTween(1, tween);

    timeline.calculateDuration();

    Thanks,

    -G

  15. Awesome job Grant! I have one question on GTweenFilter. Can you use the Color Effects in there at all?

    For example, if you wanted to animate a Tint or Brightness that you had applied in the Properties Panel under the Color Effects section, could you do that? Or a red offset under the Advanced section of that same panel? I know I’m asking a ton here, but, I’m just curious. Thanks!

  16. Please keep the questions and bug reports coming. I’ll try to answer them as I have time (my next couple weeks are insane).

    Kevin – you can animate colorTransform effects by taking advantage of setAssignment. This lets you animate the properties of the colorTransform object, and automatically reassign it back to the target every time it is updated. I believe there is some sample code in the setAssignment documentation.

  17. Grant, thanks for the info! I don’t know how I missed that. This will work!

  18. Hey Grant, I have a question about declaring a MultiTwee var. You can re-use GTween instances after you declare the GTween var, but can you do the same with a MultiTween so you’re not making a new var each time?

    For instance, you can use:

    var introTween:GTween = new GTween(null, 0.25, null,{ease:Cubic.easeOut});

    but

    var mt:MultiTween = new MultiTween([null],[{null}], null);

    var mt:MultiTween = new MultiTween([],[{}], null);

    var mt:MultiTween = new MultiTween([],[], null);

    var mt:MultiTween = new MultiTween(null,null, null);

    don’t work. It seems it wasn’t built for that. Or maybe I’m just doing it wrong. Thanks!

  19. Hey there, I just played a little bit with GTween and what can I say … it’s awesome so far, but there is a little bug in your currentLabel getter (GTweenTimeline). It doesn’t return the right labels. Just try labels like

    tweenTimeline.addLabel(10, “ALabel”);

    tweenTimeline.addLabel(20, “BLabel”);

    tweenTimeline.addLabel(40, “CLabel”);

    this will return “CLabel” at any tweenPosition.

    the getter should probably look something like this:

    public function get currentLabel():String {

    var minDelta:Number = -(duration+1);

    var label:String;

    for (var n:String in labels)

    {

    var delta:Number = labels[n]-_tweenPosition;

    if (delta minDelta) {

    label = n;

    minDelta = delta;

    }

    }

    return label;

    }

    cheers

    Martin

  20. there’s a bug in the GTween.copyObject function.

    It must be :

    protected function copyObject(o:Object):Object

    {

    var copy:Object = {};

    for (var n:String in o)

    {

    copy[n] = o[n];

    }

    return copy;

    }

    thanks for your work !

    cheers

    lomitko

  21. Awesome tweeningengine!

    Is it also possible to tween a ColorMatrixFilter? The only value of the ColorMatrixFilter is the matrix array. The values of the matrix (matrix[0]) does not work. Any idea how to tween the values? I thought about tweening the values separated and making an update method, whichs adds the filter on every update.

  22. Small question, why does GTween uses instances instead of static calls such as the Tweener class?

    The frontpage says “gTween is built for ActionScript 3 developers from the ground up. It uses a more conventional instance-oriented model, rather than a static interface.” but it doesn’t say why.

  23. Great work. I will immigrate my application to GTween assap.

  24. I’m having the same problems as Giraldo mentioned:

    var tween:GTween = new GTween(field, 0.5, {alpha: 0}, {ease: Quadratic.easeOut});

    tween.addEventListener(Event.COMPLETE, tweenCompleteHandler);

    function tweenCompleteHandler(event:Event):void {

    var tween:GTween = event.target as GTween;

    tween.reverse();

    }

    Nothing happens, fonts are embedded as well. I’ve also tried it via the proxy approach but sadly with the same result.

  25. I have also problems with the Event.COMPLETE.

    You interrupt demo shows how easy it is to interrupt the tween and add a new value to the proxy. this also works fine. but if i want to change the proxy value in the Event.COMPLETE, the tween wont work. If i fire the “makeTween” function delayed over a timer, it works fine. seems, that i only can change the proxy values before and after the tween complete event, but not when the tween event is fired.

    Example:

    private function initialize() : void

    {

    _shape = new Shape();

    _shape.graphics.beginFill(0x0000FF);

    _shape.graphics.drawEllipse(-20, -20, 40, 40);

    _shape.graphics.endFill();

    _shape.x = 500;

    _shape.y = 250;

    addChild(_shape);

    _tween = new GTween(_shape,1);

    _tween.addEventListener(Event.COMPLETE, onEnd, false,0,true);

    makeTween();

    }

    private function makeTween():void

    {

    _tween.proxy[“x”] = Math.random()*500;

    }

  26. Beta 5 is looking great!

    I’m excited about the getProperties method, but unfortunately it does not appear to be working.

    Consider the following example:

    var tween:GTween = new GTween (MyObject, 1, { x: 100 } );

    var properties:Object = testTween.getProperties ();

    trace (properties.x); // undefined

    trace (properties[“[object Object]”]); // 100

    Thanks for this great tweening library!

  27. Ah, I see that someone already posted the fix for copyObject.

    The other issue I see is that tweens with a time of zero don’t work. I know this is kind of a misnomer — tweens with no time — but I liked that a tween time of zero used to set the target property to its final value immediately.

  28. Jordi,

    Many developers prefer the object-based approach GTween and other tweening libraries use over a static function. However, I have created a static manager for GTween that provides the functionality you are asking for.

    You can read more about it here:

    http://www.flashdevelop.org/community/viewtopic.php?f=7&t=4172

    I’ll be posting an updating version which implements updates for GTween Beta 5 soon.

  29. Hey Joshua,

    Thanks for your reply. It’s good to know that you have this version of GTweener, and I might use it. But still the question remains why people would prefer calling an instance’s functions instead of some static functions. Just wondering, so in the future I can make the right decision for either yours or GTween.

  30. Great work on the latest update, I love the direction it’s heading with GTweenTimeline.

    I had a couple suggestions after working with it on a couple project:

    1. Allow for MultiTweens to be added to a GTweenTimeline.

    2. Allow for multiple callbacks to be added to a specific position.

    It’s been mentioned a couple times already, but the callbacks get unexpectedly called at the end of the GTweenTimline as well as at their specified position. I’m not sure if that was the intended functionality, but it took me by surprise and caused some extra work to ignore the second time they got called.

    From a quick test it looks like the issue only occurs when you don’t have reflect on. There is a second checkCallbackRange() call within checkCallbacks() that seems to be causing the callbacks to trigger at the end.

  31. Hi Grant,

    Just started using Beta5, nice work! However I had a couple of problems, which had me scratching my head for a good couple of hours.

    The first problem was easy to solve, which was that entering a duration of 0 does nothing.

    The second one was harder to find a solution for. I had it set up so that on completion of one tween, the same tween was given a new value, and started again. The issue occurred because paused was being set to true after the complete event was dispatched. This meant that I was telling it to play and it was immediately being paused again. Swapping lines 744 and 745 (in setPosition) solved that one 🙂 Is there any reason why it was that way round?

  32. Just saw this tool and tried it out because i want to do some dynamic motion tweening.

    In my case i was trying to tween a tree branch to have slight but dynamic movement on mouseOver. I created a global GTween variable and upon mouseOver i set the GTween properties as follows:

    branchInitTween.setProperties({rotation:(scaler*rotationAmount)});

    branchInitTween.setTweenProperties({duration:4});

    That works correctly, with no jumping because my duration is 4 seconds. However, if I try to change durations based on the distance of the tweens as seen below:

    branchInitTween.setProperties({rotation:(scaler*rotationAmount)});

    time = Math.round((distance*(speed))/(rotationRate));

    branchInitTween.setTweenProperties({duration:time});

    the animation will pop and jump and eventually crash because the duration is made to be dynamic. ie changing from 0 to n as necessary.

    I may be using your api incorrectly, but based on your documentation this seems correct.

    Any advice on how to pull something like this off with the jumps?

    Jeff

  33. Where can i read about GTweenTimeLine class

    because you put some functionality for parallel playing of “effect’s” in this class and i have many question like howe properly put them …for now i use addTween method whith first attribute 0 what i think mean that is first order plaing, but i have qustino how can o catch the moment when first group of tweens will be finished …

    for example i have two

    var tw1:GTween = new GTween();

    var tw2:GTween = new GTween();

    var gtl:GTweenTimeline = new GTweenTimeline();

    gtl.addTween(0,tw1);

    gtl.addTween(0,tw2);

    …. i think that it’s will bring that two effects will play parallel and i want to registrate function what will be doing in at the end of the effect …

    for standart parallel efect is easy is just addEffectListener … but how to do it with GTween …. it’s realy useful think … can you explaine

  34. Jordi,

    Sorry about the delay.

    I updated information for GTweener here:

    http://code.google.com/p/gtweener

    Sometimes the global approach can be kludgy and inefficient when compared to a local instance. However, when done right, I believe that keeping tweening global can give you a few advantages.

    For me, using GTween in combination with GTweener provides the best of both worlds. You can use it like a global function, but you can grab (or register) a local GTween instance for when you want to get more specific and take advantage of some of GTween’s unique features.

  35. Does GTween have any way of tweening the color of a TextField? My attempts result in flickering color. Tweener can do this properly, but it is 3x larger…

  36. Hi Grant,

    GTween doesn’t seem to work with durations of 0. Am I maybe doing something wrong?

    var sp : Sprite = new Sprite();

    sp.graphics.beginFill(0);

    sp.graphics.drawRect(0, 0, 100, 100);

    sp.graphics.endFill();

    addChild( sp );

    new GTween( sp, 0, {alpha: 0} );

    Thanks!

    Florian

  37. Hi Grant,

    thanks for this amazing tween API.

    I’ve this tween

    new GTween(s, .1, {x:100.752, {ease:Quint.easeIn});

    I would like to use snapping:true property to round pixel coordinates but in the documentation I couldn’t find an example of the hash table to pass as snappingProperties parameter.

    Could you provide me an example please?

    Thanks

  38. I’m afraid there is a bug with the autoPlay property – it’s not possible to set it to false.

    The problem is, that the construtor invokes the invalidate() method prior to the setTweenProperties() method.

  39. i have down this file(“GTween_beta5″),the problem is can’t open the fileGTweeny3D_FlashCS4.fla”),i want to study flash about 3D,please help me, thank you!

  40. Hey

    Tested GTweeny for an banner ad. The delay property didn’t seem to work.

    Looked at GTween and noticed that it was abit different:

    // GTweeny

    public function set delay(value:Number):void {

    _delay = value;

    if (_position == -_delay) {

    _position = -_delay;

    }

    }

    // GTween

    public function set delay(value:Number):void {

    if (_position == -_delay) {

    setPosition(-value);

    }

    _delay = value;

    }

    Tested using GTween’s setter for delay and it worked.

  41. Hey!

    It’s possible to delay each of MultiTween obiect seperately ?

    var tween1:GTween = new GTween(null,2.8,null,{reflect:false,repeat:-1,ease:Exponential.easeOut});

    var mt:MultiTween = new MultiTween ([tekst3,tekst4,tekst1,tekst2,tekst5,tekst6], [{x:494},{x:495},{x:484},{x:485},{x:700},{x:700}], tween1);

    thanks

    Filip

  42. Hi, great work Grant!

    Unfortunately as Kristin mentioned, addCallback in GTimeline adds the function call at specified time and once more in the end of the GTimeline. Or maybe it was fixed lately? Is there any newer version accessible?

    Cheers, thanks,

    JZ

  43. Found a bug in GTweenFilter.

    If you start a filtertween, then remove that filter in another function before the tween is finished, then index ‘0’ in the filters array does not exist. So naturally this throws errors. It might be beneficial to catch that if the filter array is empty.

    Thats never a good practice, I know, but it just popped up consequentially. I’ll fix that on my side, but it’s something that someone might run into at some point.

  44. How could I make a simple color fading ?

  45. jiri Heitlager April 8, 2009 at 11:52pm

    Nobody seems to be able to tell me how to do a color tranformation to and from an RGB value. I followed your hint made in the comments, resulting in the following code.

    But the color is flickering and not the desired result 😉 . Could you please shed some light on how to achieve this. My ‘flickering’ code is below.

    import fl.motion.easing.*;

    import com.gskinner.motion.*

    var colorInfo:ColorTransform = clip.transform.colorTransform;

    var myTween:GTween = new GTween(clip,2,{color:0xFFcc00});

    myTween.setAssignment(clip.transform,”colorTransform”);

  46. Default timing does not make sense. The default value for GTween constructor second argument time is 10. The default timingMode is HYBRID – which means default timing is 10 seconds.

    Why can’t I change default time? I want to use HYBRID mode and want to specify in 1 central place, that default timing is .3 seconds? I need to roll my own global constant and pass it to all constructors everywhere – it seems silly.

    Also, I think it is silly to have time as the second argument to the constructor – time should only be specified in a few places where it is something other then default fading-interval (where .3 seconds should be standard).

    My suggestion is more conceptual than technical, and you have probably discussed this many times over. But I would just like to add my 2 cents to the debate anyway 🙂

    Morten Barklund

  47. Hi Grant,

    We use GTween on most new projects and love it. Thank you for the awesome engine.

    We delegate tasks to devs that sometimes involve modules and have run into some CPU problems using GTween. If multiple modules specify GTween.timingMode = GTween.TIME, multiple timers are created and run unnecessarily contributing to additional CPU overhead.

    I’ve added a check that looks for an existing static timer instance and prevents duplicate timers from being created in this case.

    Thanks again!

    Justin

  48. I need to make a news ticker but using the Timer class or using enterframe gives meannoying flickering.

    I read this is because the Timer Class is inaccurate.

    A possible workround would be to use the sound oncomplete event as timer. Any experience in that?

    thanks, bart

  49. I added a function to remove all the tweens from the GTweenTimeline. The implementation removes all instances from the tween and position arrays, wihtout creating new memory. Here it is, if any comments please do so.

    /**

    * Removes all tweens from the timeline.

    */

    public function removeAllTweens():void

    {

    var i:int = tweens.length;

    while (–i >= 0) {

    tweens.splice(0,1);

    tweenStartPositions.splice(0,1);

    }

    }

  50. Excellent work, Grant. I really appreciate people like you who take the time to compile ultra-awesome libraries like this and then release them for free to anyone that wants it.

    Keep up the great work.

  51. I’ve decided to give gTween a try on a personal project (I typically use Tweener). I have read several posts about the proper method of tweening color transform properties with gTween, and I believe that I am doing it correctly. However, I am getting some strange results. If I tween a clip with 128,128,128 RGB colors (0x808080) to 255, 153, 000 I should see an orange color (0xFF9900, but I am getting a yellow color. This does not happen if the original color is white. I tried another method where I tween the color property of a color transform and I get the correct color, but the object goes through a rainbow of other colors first. I just want to tween from grey to orange. Anyone know what I am doing wrong? Or am I just expecting gTween to perform some magical impossiblility?

    My code examples:

    //tween from current color to orange using offsets

    var orangeTween:GTween = new GTween(this._target.transform.colorTransform, 1, {redOffset:255, greenOffset:153, blueOffset:000}); orangeTween.setAssignment(this._target.transform, “colorTransform”);

    //note: tweens to the wrong color if the target’s color is not white.

    //tween from current color to orange using color property

    var orangeTween:GTween = new GTween(this._target.transform.colorTransform, 1, {color: 0xFF9900});

    orangeTween.setAssignment(this._target.transform, “colorTransform”);

    //note: tweens to the proper color but goes through a rainbow of colors first (we want grey to orange – works with Tweener).

  52. benjamin foucaud June 14, 2009 at 2:33pm

    Hi Grant, congrat for this engine, I’m searchin to use it for a long, but the ease of onComplete method in Tweenmax, etc…

    make make me choose it.

    I think I will create a Gt tweenEvent class that will dispatch it when tween state is at End.

    but do you think there is another way and even more great:

    is there a way to already easily embed it???

    I didn’t found it…

    thank you so much !!!

  53. Hi,

    The library is very good and very useful.

    However I am facing an issue. I am basically trying to do a small tween where a movie highlights half a second (by size, blur etc.) and then it should return to its normal state. My tweens are sometimes not returning even if I have “reflect” as ON. Sometimes it works when “reflect” is OFF !

    I have tried different combinations of reflect=true/false with repeat=-1,0,1,2,…

    It works sometime and I make some other stupid change (e.g. duration of the tween) and it stops working. Then I change something else, it starts working and then when I am coding something else, it stops again.

    I am at loss of wits 🙁 Please help.

    I have lot of other tweens in the same code, if that is of any help to you for debugging.

    Thanks,

    Mukesh

  54. I just separated out my code and put it in a smaller fla file.

    Can you see if I am doing anything wrong?

    Here it is:

    import com.gskinner.motion.*;

    import fl.motion.easing.*

    import fl.transitions.easing.*;

    import flash.filters.GlowFilter;

    var timeline:GTweenTimeline = new GTweenTimeline(null,0,null,{repeat:0,ease:Linear.easeNone,reflect:false});

    var tween:GTween = new GTween(animationx,1,{x:40,y:30},{ease:Linear.easeNone});

    timeline.addTween(0,tween);

    timeline.calculateDuration();

    var color:Number = 0x0000FF;

    var bluralpha:Number = 0;

    var blurX:Number = 0;

    var blurY:Number = 0;

    var strength:Number = 0;

    var quality:Number = 4;

    var inner:Boolean = false;

    var knockout:Boolean = false;

    var glowfilter:GlowFilter = new GlowFilter (color, bluralpha, blurX, blurY, strength, quality, inner, knockout);

    animationx.filters = [glowfilter];

    var ft:GTweenFilter = new GTweenFilter(animationx,.8,{blurX:3,blurY:3,strength:1.7,alpha:0.5},{reflect:true,repeat:1,filterIndex:0,ease:Strong.easeOut});

    //ft.reversed = true;

    timeline.addTween(1.5,ft);

    timeline.calculateDuration();

    stop();

  55. And I should mention that in the example I gave above, I am only expecting the second tween to return back. First motion tween is just a dummy one.

  56. Grant,

    I found a bug that was driving me nuts. It has to do with the GTweenTimeline setPosition() function. This method will cause a ‘complete’ event listener to be called before the timeline has finished playing all of the tweens.

    I was trying to set the final position of objects when the tween ‘complete’ event was dispatched, but the objects would always end up in the wrong position.

    I have not had a chance to write a fix yet but will in the next couple of days. Hopefully, this bug will be fixed in the next release.

    Thanks for the open source tweening engine.

  57. Grant,

    Huge bug or something ridiculously simple?

    When adding a GTween to a GTweenTimeline, all initListener properties are completely ignored. completeListeners work perfectly though.

    I’ve tested this on your GTweenTimeline Demo, and the initListeners are failing just the same.

    What’s going on?

  58. Another bug that may be related to the same problem:

    When adding a GTween to a GTweenTimeline, “repeat” doesn’t work. The GTween only lasts as long as its duration and stops, ignoring the repeat:-1 attribute.

  59. This initListener problem is definitely a bug.

    It has to do with the ‘reversed=true’ property:

    When reversed is set to ‘true,’ the class forces an initListener function that immediately sets the object to the tween values specified, which allows it to play it backwards from those points.

    However, that action uses up the only slot for an initListener, so any initListeners that we need to execute in the .fla file are completely ignored.

    I advise some kind of patch, since this problem renders an initListener completely useless. In my case, I can’t easily sync a sound effect to a reversed tween.

  60. as Stepan commented,

    autoPlay property doesn’t work in my condition.

    i’m sad……..

  61. wow, it seems there are still many bugs, and not so many answers to the questions 🙂

    Btw, I second the bug on the addCallback which fires twice, at the right time and at the end of the animation. Since my animation doesn’t need to be reverted I could easily comment line 302 of GTweenTimeline.

    Best and thanks for the effort.

  62. Hi!

    I’m using GTween to create a ticker. When the tween is complete I have to check if I need to update the ticker text so I can’t use repeat. How do one restart a tween manually after updating the target object?

    Thanks in advance,

    Christer

  63. Hi!

    I noticed new version should run on Flash10,

    Does it possible run it on Flash9 or get a previous version to run on Flash9?

    Thanks

  64. sy – GTween should run fine in Flash Player 9.

  65. Very nice package. This simplifies a lot, and adds a lot of functionality. I will be using this in one of my projects coming up.

    I really appreciate your work. I have had a lot of similar ideas, and have coded a lot of what is in this package, but invariably fail to compile my work and have it make sense or be usable to anyone else. This has to do partly with time constraints and job requirements, but also because I just never do that sort of thing, even when I have time. Without you and your work, I (and a lot of other people) would be spending a lot of time re-coding what you have done. Your work is valuable and memorable to me.

  66. Hi Grant, I may have discovered a bug in Gtween 5

    It seems the autoVisible option is setting the visible property on every enterFrame. This slows things down a little for me, since I’m overriding the set visible function and doing some stuff before setting the objects visibility, I know I can avoid it simply by adding an if statement to check if visible is already set, but wouldn’t it be more correct to set visible on the end of the tween only?

    BTW thanks a lot for giving us GTween!

    Cheers Kim

Comments are closed.