Jump to content
GreenSock

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

Method similar to createjs.Tween.removeAllTweens()

Recommended Posts

I am currently working on a project- I have been using TweenJS. But I have fallen in love with versatility with GSAP. The only thing I am trying to figure out is if there is a similar function for GSAP that removes every instance of a tween like CreateJS createjs.Tween.removeAllTweens(); 

 

I have found myAnimation.kill(); but from what I can tell that is a per instance usage and I am looking for more of an overall function when I go to reset that would remove all tweens.

Link to comment
Share on other sites

Hey DDINCBrent and welcome to the GreenSock forums! We're glad that you're enjoying the versatility that GSAP offers :)

 

You should be able to use gsap.killTweensOf() with a universal selector ("*") for this. For example:

See the Pen bGNYNJJ by GreenSock (@GreenSock) on CodePen

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

@ZachSaucier Thank you for the response! Is there somewhere I can go to see those little secrets about functions like that? I was looking at the Documentation for it and it doesn't mention using the asterisk. But once again thank you! :D 

Link to comment
Share on other sites

Just now, DDINCBrent said:

Is there somewhere I can go to see those little secrets about functions like that? I was looking at the Documentation for it and it doesn't mention using the asterisk.

Well, you can use any selector string as the target. So the universal selector is implied. But it should probably be documented explicitly as it's probably the most common specific use case. I'll add it to the docs when I am able to.

  • Like 2
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×