Xristi Posted August 5, 2020 Share Posted August 5, 2020 I try to establish a variable for my delayed calls so I can kill them under certain circumstances. When I use the form var dC_1 = gsap.delayedCall(1, myFunction); as suggested gsap shows an error as undefined. What do I need to import to eliminate the error? When I use var dC_1 = TweenMax.delayedCall(1, myFunction); I get an error as well. I am a Shockingly Green member... perhaps I should upgrade some of my gsap imports? Link to comment Share on other sites More sharing options...
PointC Posted August 5, 2020 Share Posted August 5, 2020 Your syntax is correct. Are you loading gsap before your custom JS? What GSAP version are you loading? Do you happen to have a demo showing the error? 2 Link to comment Share on other sites More sharing options...
ZachSaucier Posted August 5, 2020 Share Posted August 5, 2020 13 minutes ago, Xristi said: perhaps I should upgrade some of my gsap imports? I notice that you are using the old syntax. We highly recommend using GSAP 3 and the GSAP 3 syntax. See the migration guide for more info: 2 Link to comment Share on other sites More sharing options...
Xristi Posted August 5, 2020 Author Share Posted August 5, 2020 Hi Zach, The link only tells me of the changes made for gsap 3. I did find a link called "How to get it" but it's dead. Link to comment Share on other sites More sharing options...
PointC Posted August 5, 2020 Share Posted August 5, 2020 Which link is dead? Try this please. https://greensock.com/docs/v3/Installation 3 Link to comment Share on other sites More sharing options...
Xristi Posted August 5, 2020 Author Share Posted August 5, 2020 Thank you, Craig... got it. I've gone to many different gsap pages - don't recall where the link is except that it said "How doI get it?" Link to comment Share on other sites More sharing options...
PointC Posted August 5, 2020 Share Posted August 5, 2020 No problem. Is your delayedCall error now gone with the latest release? 1 Link to comment Share on other sites More sharing options...
Xristi Posted August 5, 2020 Author Share Posted August 5, 2020 Yes! gsap is being read... now, can I instantiate a delayedCall that I have declared a variable for - I know how to kill it now but not how to give it life! 1 Link to comment Share on other sites More sharing options...
PointC Posted August 5, 2020 Share Posted August 5, 2020 Cool. Thanks for letting us know that everything is working for you now. Thanks for being a Club member. Your support is greatly appreciated. 1 Link to comment Share on other sites More sharing options...
GreenSock Posted August 5, 2020 Share Posted August 5, 2020 9 minutes ago, Xristi said: can I instantiate a delayedCall that I have declared a variable for - I know how to kill it now but not how to give it life! You mean like this?: let myCall = gsap.delayedCall(1, func); 1 Link to comment Share on other sites More sharing options...
Xristi Posted August 5, 2020 Author Share Posted August 5, 2020 Hi Craig, One more thing... After I have declared the variable for the delayedCall and killed it can I bring it back to life via the variable? Link to comment Share on other sites More sharing options...
GreenSock Posted August 5, 2020 Share Posted August 5, 2020 If you kill() something, it's dead. Don't kill() it if you need it later. Just pause() it instead. It might help if you provided a minimal demo so we can see the context and better understand your goal. A delayedCall() is just a tween instance with an onComplete/onReverseComplete. So you can also myCall.restart(true) to start it all over again. 3 1 Link to comment Share on other sites More sharing options...
Xristi Posted August 5, 2020 Author Share Posted August 5, 2020 Hi Jack, Great explanation! Thank you!! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now