Jump to content
Search Community

Killing all tweens when skipping to another frame?

madfatter test
Moderator Tag

Recommended Posts

Hi,

 

I've got an intro animation playing in frame one of my movie with a "skip intro" button that takes you to the next frame. The intro uses a series on TweenMax tweens and when I click the skip intro I'm often encountering this sort of error:

 

at metro_sexual_fla::MainTimeline/removeStyleTint()

at Function/http://adobe.com/AS3/2006/builtin::apply()

at com.greensock.core::TweenCore/complete()

at com.greensock::TweenMax/complete()

at com.greensock::TweenMax/renderTime()

at com.greensock.core::SimpleTimeline/renderTime()

at com.greensock::TweenLite$/updateAll()

 

What's the best way to tell TweenMax to stop everything in that frame before moving to the next frame?

 

Thanks for any advice.

Link to comment
Share on other sites

Sounds like you've got some sort of problem in your removeStyleTint() method, but you didn't include the exact error message so it's tough to say. Maybe a null reference?

 

Anyway, you can kill all the tweens of a particular object anytime using TweenMax.killTweensOf(). If you've got a bunch of tweens going for various things, you can dump 'em into a TimelineLite so that you can just kill() that TimelineLite whenever you want. http://www.greensock.com/timeline-basics/

Link to comment
Share on other sites

I'm pretty sure that the problem is that by pressing the skip button I'm leaving tweens in mid stream and the objects that they're tweening are no longer in the current frame.

 

Am I right to assume that to use TweenMax.killTweensOf() I'd put the name of the movie clip being tweened as the parameter?

 

Thanks so much for your help!

Link to comment
Share on other sites

Am I right to assume that to use TweenMax.killTweensOf() I'd put the name of the movie clip being tweened as the parameter?

Yep. Well, the target itself (a reference to it) which in your case is a MovieClip. TweenMax.killTweensOf(myMovieClip). Don't pass a String, though. NOT TweenMax.killTweensOf("myMovieClip")

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.
×
×
  • Create New...