Jump to content
Search Community

scottgroovez

Business
  • Posts

    16
  • Joined

  • Last visited

Posts posted by scottgroovez

  1. Hey, in your codepen you’re creating 2 gsap timelines. One in the main body and another in the gameEnd function. Each time gameEnd is called it creates a new one.


    I’ve forked your codepen and made some adjustments. I had to add a gsap.set to reset opacity to 1 otherwise the time would disappear (I’m on my phone so couldn’t debug why that happens)


    The significant changes were deleting the finalSBPrint2 variable inside the gameEnd function so there’s only one reference to the gsap timeline and removing the duplicated addEventListener. I also removed the code creating the timeline outside gameEnd and just called gameEnd on init as that again was duplicated code.

     

    See the Pen XWVqOqV by whizz-shumphrey (@whizz-shumphrey) on CodePen

    • Like 1
  2. Hey, I have a timeline tween that repeats a number of times. When it's complete I want it to return to its initial state. I could do this using an onComplete, but I wonder if there's an available prop that does this automatically?

    • Thanks 1
  3. Hi,

     

    I'm tweening the tint on a textfield as an infinite repeat. At some point the tint colour needs to change. What I want to do is clear the tint and then create a new tween to tint it with the new color. How do I kill the tint and reset it back to its original color before tweening it again?

  4. I had a friend test it on his iPhone5 and it worked fine (much better performance too) and another tested it with iPhone4 with iOS5 and that also worked. However I'm using an iPhone 4 with iOS6 and tis not working.

     

    Testing through web developer tools shows no JS errors, but I did manage to isolate the problem to a line in the JS generated by the CreateJS Toolkit for Flash, so I'll be posting my problem on their forum.

     

    PS. I've only just realised there's a specific JS greensock forum, so feel free to move this topic there.

    • Like 1
  5. I'm using the JS version of greensock and I have an issue with an onComplete function being called when overwriting a tween and creating a new timelinelite instance.

     

    So, effectively I create a number of tweens and add them to an array that I then parse into insertMultiple method of a TimelineLite instance.

     

    I've tried killing the timelinelite timeline before creating a new one, but the onComplete function is still called. How do I prevent the onComplete function being called when overwriting/creating a new instance of the timelinelite?

     

    for(var x = 0; x < 12; x++) {
      if(has_children) {
    m = c.getChildAt(x);
      } else {
    m = new createjs.Text();
    m.x = (20*x);
    c.addChild(m);
      }
      m.y = 0;
      m.alpha = 1;
      m.text = multiple * (x+1);
      ta.push(TweenMax.from(m,0.5,{y:20,alpha:0,ease:Back.easeOut, overwrite:1}));
     }
     if(this._tl != null)
      this._tl.kill();
     this._tl = new TimelineLite({onComplete:function(){console.log("Hi");root._msg1.visible = root._msg2.visible = true; root._msg1.text("Here is the pattern for x times table.");root._msg2.text("This can be carried on to give more multiples of x")}});
     this._tl.insertMultiple(ta,"0","start",0.1);
    

  6. I'm creating a "washing line" type interface which has thumbnails hanging from it. I want to be able to scroll the washing line and have those thumbnails sway when the motion starts and then swing when the tween stops.

     

    Can anyone point me towards the best way of achieving this?

     

    Regards,

    Scott

×
×
  • Create New...