# eigenface

Members

72

1. ## how to use a timeline as a tween group

Thanks for the help.
2. ## obtaining an overall time / constant speed thru a series of bezier tweens with variable path lengths?

Thanks. For anyone who is reading this thread after searching for the same topic, like I did, I found a good quadratic bezier length algorithm here: https://code.google.com/p/bezier/source/browse/trunk/bezier/src/flash/geom/Bezier.as I found other implementations didn't handle edge cases well - sometimes they returned NaN.
3. ## obtaining an overall time / constant speed thru a series of bezier tweens with variable path lengths?

I'm in a similar situation to da2020, in that I need to be able to specify the speed of an object on a bezier tween. In order to get the duration, I need the distance along the bezier curve. I could use a similar solution, that is, convert "thru" points to quadratic control points using BezierPlugin.bezierThrough, use a custom algorithm to calculate the bezier curve length from the control points, and then use a type:"quadratic" bezier tween with those same control points. However, I notice BezierPlugin has a _length property which appears to be the total bezier curve length, or at least the approximate length that BezierPlugin uses. Is it better to use the value of this _length property when calculating duration from speed (because this is the length of the path an object on the tween will actually follow)? Would it be possible to expose this _length to the public API in some way? It would be handy, and it seems a shame not to expose it, if it's already being calculated anyway.
4. ## how to use a timeline as a tween group

Thanks so much for this detailed explanation. My previous example works correctly if I add smoothChildTiming:true to the parentTimeline as you've indicated. To be honest, I didn't fully understand the explanation. I have a few questions, to make sure I'm setting things up correctly in my project. In my project, I want to put user-generated tweens in several different bottom-level timelines so I can pause/kill them by category (carsTimeline, trainsTimeline...), as well as add the timelines as children of a common parent timeline so I can pause/kill everything easily. Also, I want the bottom-level timelines to have autoRemoveChildren:true, so I won't accumulate completed tweens (which are never used again.) 1. Do I need to add smoothChildTiming:true to every ancestor timeline, except the bottom-level timeline which contains the tweens, like so? carsTimeline = new TimelineMax({ autoRemoveChildren:true }); parentTimeline = new TimelineMax({ smoothChildTiming:true }); grandParentTimeline = new TimelineMax({ smoothChildTiming:true, paused:true }); ... carsTimeline.add(TweenMax.delayedCall(carDelay, spawnCar), carsTimeline.time()); ... parentTimeline.add(carsTimeline); grandParentTimeline.add(parentTimeline); ... grandParentTimeline.play() As you can see, I also have paused:true in the top-level timeline, so I can add some initial tweens (in fact, delayed calls) and start them later. 2. I don't need to use totalTime(), right? (time() honors delays, just not repeatDelays)

6. ## how to use a timeline as a tween group

Thanks a lot, Jack and Carl! Everything works as expected now.

8. ## how to use a timeline as a tween group

Thanks, Carl! Your mouseDownHandler almost works correctly. The first click jumps to somewhere in the middle of an alpha fade already in progress, depending on how long you wait before clicking the first time. Subsequent clicks have the desired effect. I have been using the latest version of GSAP (12.1.2) - are you seeing this first-click problem also? In addition, I just want to get confirmation that I'm not crazy - my original mouseDownHandler looks like it should work, right? (It exhibits the same weirdness it always did if I switch totalTime to time.) My mouseDownHandler looks like a different way of writing your mouseDownHandler, but the visible behavior should be the same. The fact they exhibit different behavior seems buggy. Or am I missing some subtlety of the API?

10. ## best way to simulate animation in non-realtime?

Thanks for the great example! This seems to work well. I notice you don't pass the 'paused:true' parameter to the tween or the timeline. This doesn't seem to make a difference one way or the other to the loop (the actual animation does not run if paused, of course.) Are there any subtle reasons why passing 'paused:true' is not a good idea?

12. ## legacy bezier behavior

Oops, posted at the same time. Thanks for the help. For future reference, the correct code is: TweenMax.to(this, pathTime, { bezier:{ values:pathObjArray, autoRotate:true, type:"soft" }, ease:Linear.easeNone, onComplete:onComplete }); where pathObjArray.length == 3 because the endPoint values have been added to the end of values:pathObjArray.
13. ## legacy bezier behavior

Did you by any chance change whether or not the end point is supposed to be included in the bezier point array? I ask because even though my point array has 2 points, when I use type:"quadratic", I get an error which looks like it's due to not having enough bezier points. Adding the end point to the bezier point array causes even weirder behavior, though. I'm just taking shots in the dark here as to how the bezier tween has changed from v10 to v12, it would be nice to have a "canonical" translation.
14. ## legacy bezier behavior

A while back, I made a flash app using gs v10, using bezier tweens. Recently, I recompiled it for some necessary maintenance, using gs v12. The bezier tweens are messed up - the sprites being tweened don't orient to the curves, and sequences of bezier tweens that used to flow smoothly one into the next now make the sprite suddenly jump from one angle to a different angle when one tween stops and the next one starts. I've tried testing out all the new bezier settings (including type:"thruBasic"), trying to recreate the behavior of the v10 tweens, but I can't figure out how. Is there a way? My original tween code looked like this: TweenMax.to(this, pathTime, { x:endPoint.x, y:endPoint.y, bezier:pathObjArray, orientToBezier:true, ease:Linear.easeNone, onComplete:onComplete }); where pathObjArray.length == 2. What code should I use to recreate the same behavior as closely as possible in v12?

16. ## bug in TimelineLite

Thank you for looking into this so quickly. Unfortunately, the new version of TweenLite you attached does not fix the problem. My coworker isn't using fromTo or from - looks like he' s just using TweenLite.to, TweenLite.delayedCall, and timeline.add.
17. ## bug in TimelineLite

A coworker came to me for help figuring why his tweens stopped displaying correctly. We're using version 12, updated today. He's making heavy use of TimelineLite (and TweenLite, but NOT TimelineMax or TweenMax.) I believe this is a TimelineLite bug because: 1) I updated my GS classes on February 22 (after this change was made: http://www.greensock.com/v12-api-change/.) His tweens worked correctly. 2) I updated my GS classes today. His tweens broke. 3) I rolled back all my GS classes to February 22, but left his and all other code unchanged. His tweens worked correctly. 4) I updated all my GS classes except TimelineLite to today. His tweens worked correctly. 5) I updated TimelineLite to today. His tweens broke. My coworker is setting useFrames to true and tweening through the frames of MovieClips. It looks like his clips get stuck on their final frame after the 1st tween, as if they're not being reset to frame 1 for subsequent tweens. He's using the onComplete callback to reset the clips to frame 1 - maybe the callback isn't being called in some cases. He's using a lot of TweenLites and TimelineLites, and I don't have the time right now (or ever, probably), to go through all his code and isolate a simple test case for the bug. I don't think he or I should have to, because in light of my sequence above, I don't see how it could be possible for this not to be a bug in TimelineLite. I hope you'll look into it.
18. ## How to know whether the down-load was successful or failed.

Would the same logic not apply? Would it be more intuitive if skipPaused applied to everything inside the LoaderMax instance? Also, it might be more intuitive if the behavior of skipPaused was consistent with the behavior of skipFailed.
19. ## How to know whether the down-load was successful or failed.

I wonder, does skipPaused work the same way?
20. ## How to know whether the down-load was successful or failed.

Yes, this seems to work right for my example. Now I only have to set skipFailed on loadQueue to prevent the complete event and get a fail event.
21. ## How to know whether the down-load was successful or failed.

Thank you for addressing this so quickly. The problem is fixed: now I get an error event and a child failed event before the complete event. If I set skipFailed to false on loadQueue, I still get the complete event. I have to set skipFailed on both loadQueue and configQueue to prevent the complete event and get a fail event instead. Just making sure this is the intended behavior - skipFailed refers only to immediate children, not any descendant.