Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

james.davies

Members
  • Posts

    5
  • Joined

  • Last visited

james.davies's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Excellent! Thanks so much for your help @Dipscom https://codepen.io/james-davies/pen/OKPEPX?editors=1111
  2. I've added the resources, and tweaked the code to be closer to yours, but my square is still not moving? Sorry, I'm aware this isn't GSAP related at this point, but you've already been more helpful than any tutorials I've see
  3. Hey @Dipscom, You were right, I needed to use onComplete without the parenthesis. I did have a follow up error, but that was because I was passing params without them being in an array. Thanks for the help
  4. Hi, Before I start, my code is written in TypeScript which compiles into JS. I have managed to get a yoyo animation to work as expected: public dab(): void { TweenMax.to(sprite.scale, 0.5, { x: 1.5, y: -1.5, ease: Power2.easeOut, yoyo: true, repeat: 1, repeatDelay: 0.1, onReverseComplete: this.handleYoyoComplete(), onReverseCompleteScope: this // onRepeatComplete: this.handleYoyoComplete, // onRepeatCompleteScope: this }) } protected handleYoyoComplete(): void { console.log("YOYO COMPLETE!"); } However, the method 'handleYoyoComplete()' gets called when the sprite is fully stretched out, before the yoyo starts but after the initial tween. I've tried onComplete, onReverseComplete, and onRepeatComplete. I have tried these all with and without the parenthesis (i.e. onReverseComplete: this.handleYoyoComplete() and onReverseComplete: this.handleYoyoComplete. Ultimately, is there a way of calling a method when the yoyo is fully complete? Thanks for reading, all help will be most appreciated.
×