Jump to content
Search Community

Topsy

Members
  • Posts

    7
  • Joined

  • Last visited

Topsy's Achievements

1

Reputation

  1. That's super-excellent and only ever-so-slightly less useful than a purty little diagram with circles and arrows. Thank you. I will try the v.15 preview, and I will also beef up the sample to see if I can get it to reproduce some of the other issues in case there is something else going on. It was a bit frustrating when 'exportRoot' just worked, but doing the same thing for a selected set of tweens did not.
  2. Here is a link to a sample which is showing one of the behaviors I did not expect: when collecting tweens, the frame-based tweens stop running. Am I using rawTime() incorrectly with a frame-based timeline? That's the only problem in this sample. http://optay.com/dump/greensockTest.zip
  3. Looks like I'm still on 12.0.13. I'll pull .14 and put together a sample today. I did try rawTime(), but again, it did not always put new tweens in the right place. For tweens that were offset (for example: progress changed), they would play normally when left alone, but when added to the collector timeline, they would jump to the wrong position. As helpful as the docs are for using the tools (and greensock has excellent API documentation), I feel I could really use a more thorough explanation of the system to gain a better grasp of what I *should* be doing with the tools. For example, I don't really understand the notion of the playhead in greensock. Is there just one? Does each tween/timeline have its own? What happens to the playhead(s) when you nest animations in timelines? If you create a repeating tween and change its progress immediately, what is its starttime? How does an empty timeline behave if it is empty and something gets added to it in the future or the past? These are the sorts of questions that I don't see clear answers to in the docs. I could figure out the answers by reading the source or making lots of tests, but I don't have time for that just now. I simple diagram or two would probably go a long way. Is there such a thing anywhere? Am I just missing the right page? I will see about a sample as long as there are no fires today.
  4. 1. I was monkeying with the internal properties because none of the external properties were working, and I could not find a general explanation in the docs of how timelines/tweens work with regards to the various time/delay properties and pausing and nesting and playheads and all, so I resorted to some trial and error and to looking at what exportRoot does. 2. I do not call seek() explicitly anywhere in my project. I do have some tweens that are instantiated and then set to a different time() or progress(). 5. I'm running v12... I don't see a more specific release number in the source folder or changelog. Where might I find it? 3-4. Perhaps I should just restate my original situation/question. I have a game SWF that runs in a shell SWF. I was using exportRoot to pause my game, however this was interfering with tweens in the shell. I needed something that would only gather MY tweens. My solution was to collect all the tweens used in my game into a single timeline (like the root timeline) and then just pause/resume that timeline. I modified all my calls to pass any new tween instances to a collector to be added to a control timeline. This was complicated, and I could not get it to work. Is this approach sensible? How would you collect all tweens on a single control timeline (well two, one for frame-based one for time-based)? Just using 'add()' on its own would not serve as that would append tweens to the end of the timeline. As a tween was made it needed to be added to the timeline *now* as though it were left on the root timeline. It was not clear how to achieve this, so I monkeyed with various timing properties until I got something that worked. However, I was still having problems with tweens not playing or playing at the wrong time or just disappearing (some tweened objects would go poof as though the tween had abruptly ended or reset or something) when I would pause/resume the control timeline. I'm sorry I haven't had time to put together a sample that demonstrates my situation (I can't share the actual project, and I'm still too busy with it to build a demo). I ended up brute-forcing it by storing tweens/timelines in an array and then pausing/resuming them all. I used the '_gc' property to test if the tween was still valid and worth keeping in the array (naughty naughty).
  5. I have had some success, but it has not been so smooth and easy as exportRoot. I used exportRoot as the basis for my collecting as I do not understand all of the time properties involved. First I create timelines (one for frame-based and one for time-based, I am only including the time-based code): tlTime = new TimelineLite( { autoRemoveChildren: true, smoothChildTiming: true } ); var rootTime :SimpleTimeline = tlTime._timeline, rootTime._remove( tlTime, true); tlTime._startTime = 0; tlTime._rawPrevTime = tlTime._time = tlTime._totalTime = rootTime._time; rootTime.add( tlTime,0 ); Then whenever I create a tween, I register it as follows (t is the incoming tween or timeline): tlTime.add( t, tlTime.rawTime() - t._time); The offset by '_time' is for tweens that do not start at zero-time (there a few oscillating tweens that must start in the middle). So far so good. However, when I pause and resume repeatedly, I get very flaky behavior. Pausing and resuming is just: tlTime.pause(); tlTime.play(); It appears that the "flaky behavior" is delayedCalls and onComplete callbacks not firing (though there are some mysterious disappearances whose cause I have not been able to nail down). I also had to wrap any repeating tweens into timelines before registering them though they worked fine on the root timeline. So now I am just trying to restore stability as pausing/resuming can cause the game to enter a bad state. Is there something obvious I am missing with the above code?
  6. Thank you, that will probably prove helpful. I will describe the problem I am having and try to put together an isolated sample later. I create a timeline (frame-based) to hold my tweens for pausing, but I do not add any tweens to it immediately. At some point, an object is animated and the tween is created and added to the timeline. However, the tween does not play. The behavior was inconsistent; sometimes it would play late, sometimes it would not play at all, sometimes it did play correctly. I was adding the tween at the current time of the timeline. Something like this: theTimeline.add( theTween, theTimeline.time() ) I will be digging in to this again tomorrow, and I will be back here if I cannot figure it out by myself.
  7. I was using exportRoot to pause/resume all my tweens, and it worked great! However, it is no longer desirable to pause ALL the running tweens. I need to pause some of them, but not all of them. So I made a timeline and fed new tweens to it whenever they were created, so I could just pause/resume that timeline: great in theory, but not so simple in practice. First of all, just adding a new tween to the timeline requires calculating a start time to prevent independent tweens from just stacking up end-to-end. The big problem is that the timeline becomes inactive if nothing gets added to it for a while. Then when something does get added to it, it doesn't play immediately (or at all). Is there a better way to duplicate the functionality of exportRoot more selectively? Can I create an alternative to the root timeline? Or does it just sound like my implementation is broken?
×
×
  • Create New...