Jump to content
Search Community

Zadvorsky

Members
  • Posts

    14
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Zadvorsky's Achievements

12

Reputation

  1. Thanks for the quick responses. I figured as much, this is just one of those rare instances where the GSAP api doesn't do exactly what I'd expect it to. I will probably solve this with delays as suggested.
  2. Hello friends. I ran into a strange issue: if you .addPause() to a timeline that has doesn't have any tweens inside it (only callbacks), the timeline isn't paused. See the example pen. Note that when the pen runs, both 'before pause' and 'after pause' are logged. If you uncomment either of the tweens, addPause works correctly. I know this looks a little silly, but I ran into this issue in production. I'm working on a state transition system where states have an 'enter' and an 'exit' method. The states also have a preload function, which returns a promise. In pseudo code, the transition logic looks like this: const tl = new TimelineLite(); if (currentState) { tl.add(currentState.exit()); tl.add(() => { scene.remove(currentState); }); } if (nextState) { tl.addPause(); tl.add(() => { scene.add(nextState); }); tl.add(nextState.enter()); nextState.preload().then(() => { tl.resume(); // or removePause }); } The goal is to begin preload and exit simultaneously. Then when both are done, the next state is added to the scene and it's enter animation is played. The 'enter' and 'exit' methods return a no-op function (if there is no animation for that state), or a tween (if there is an animation for that state). The issue I have is that if there is no current state (or the current state has no exit animation), AND the next state doesn't have an enter animation, the 'scene.add(nextState);' callback is triggered before the preload is complete. I can work around this in code, but I would expect the 'addPause' to work even without any tweens. Or maybe this is too much of an edge case? EDIT: Actually, it looks like both callbacks in the pen are also triggered if only the 1st tween is uncommented. But if the 2nd (or both) tweens are uncommented, the pause works as expected.
  3. I was using chrome to test it. It does seem to be running fine in other browsers, so yeah, its probably an extension issue of some kind, which is good news. Thanks for looking into it. I'll post back if/when I find the culprit, need to clean up some extensions anyway. Also thanks for your input Osu, I'll look those changes.
  4. In this demo I'm noticing a significant performance hit / choppiness when the animation first runs (click one one boxes). After that, every subsequent animation runs much smoother. I've noticed similar behavior in other projects when I'm manipulating the dom using tween max. Any ideas what can cause this / how to make it go away? Running this on a new macbook. Thanks.
  5. Thanks, that makes sense. It would be cool if this was a setting somewhere though.
  6. Hi. Sorry if this question has been asked before, but I could not find specific posts about it (or maybe my search terms are too generic ;p). Lately, I have been running into issues where a TimelineMax instance will start playing without me calling the play() method. This is a problem for me, because I am using methods that return tweens and timelines, which themselves get nested in other timelines. For example, this code could be in a button class: public function show():TweenCore { var timeline:TimelineMax = new TimelineMax(); timeline.insert(new TweenMax(background, 0.4, {alpha:1}); timeline.insert(new TweenMax(icon, 0.4, {alpha:1}); return timeline; } and outside the button class: var timeline:TimelineMax = new TimelineMax(); for each(var button:ButtonClass in buttons) { timeline.append(button.show()) } timeline.play(); Now sometimes, the timeline returned by the show method will begin playing, even if I do not call timeline.play(), and sometimes it will not. I was under the impression that a TimelineMax instance would not start playing until the play method was called, but now I am just confused. How does TimelineMax decide when to start playing? Is there anything I can do to control it? Or am I just missing something obvious?
×
×
  • Create New...