
JoeC
-
Posts
4 -
Joined
-
Last visited
Content Type
Profiles
Forums
Store
Blog
Product
Showcase
FAQ
ScrollTrigger Demos
Downloads
Posts posted by JoeC
-
-
Hello,
I've set up a timeline which has several nested animations within it. On one of the nested animations I'd like to fire an onComplete callback function so that I can change a bit of code. The problem is, the onComplete function triggers as soon as the animation begins, rather than after it. I've attached the code so you can see what I mean:
function playScene1() { var tl = new TimelineLite(); tl.to(hand, .6, { x: "-= 100%", y: "+= 0%", repeat: 1, yoyo: true, repeatDelay: 0, ease: Power1.easeInOut }, 0); tl.to(globe, .6, { x: "+= 160%", y: "+= 0%", repeat: 0, yoyo: false, repeatDelay: 0, delay: .6, ease: Power1.easeInOut }, 0); tl.to(hand, .6, { x: "-= 100%", y: "+= 0%", repeat: 1, yoyo: true, repeatDelay: 0, ease: Power1.easeInOut }, 1.2); tl.to(globe, .6, { x: "-= 160%", y: "+= 0%", repeat: 0, yoyo: false, repeatDelay: 0, delay: .6, ease: Power1.easeInOut, onComplete: exampleCallback() }, 1.2); tl.play(); }
exampleCallback() is fired as soon as the timeline begins, I'd like to inject my own function after it's finished animating. Sorry if I've missed something very simple here
-
Okay, figured this one out. Turns out you can't remove the EventListener for EnterFrame, it effectively removes the functionality of greensock, hope this helps someone else!
-
Hello. One of my functions doesn't appear to be triggering when I call onComplete. I've looked over the syntax loads, and I've tried a few different things, but 'removeFromStage' just isn't being called no matter what. I've also tried downloading in the latest swc, am I missing something completely obvious?private function bombExplode():void{TweenLite.to(bomb_MC, 1, {y:100, onComplete:removeFromStage});}private function removeFromStage():void{trace("function triggered")}
OnComplete callback fires immediately
in GSAP
Posted
Edit: I was having a problem Googling the right words
onCompleteParams: ["param1", 2] solves the following problem too:
Thanks for this, but I also need to add some parameters too, I should have added that to the original post, sorry.
Is there a way to do the following: