Jump to content
Search Community

KillChildTweensOf - syntax

MutleyDog test
Moderator Tag

Recommended Posts

I've checked the forum and the site - but wouldnt mind an examlpe of killChildTweensOf.

I've got a movie clip loading into another movieclip. At times I need to stop all the animations in the loaded movieclip. I also need to resume the movieclips when the user has read the notice appearing on the stage.

My code is:

TweenMax.killChildTweensOf(AA_All_mc.holder_mc.loader_mc,false);

 

..but the Tweens keep happening. To illustrate my point I've made a simplified version as an attachment, but the only code is:

import com.greensock.*;

import com.greensock.easing.*;

 

this.Holder.circle.onRollOver = function() {

TweenMax.to(this, 0.5, {_xscale:120, _yscale:120, _rotation:-3, ease:Elastic.easeOut});

};

this.Holder.circle.onRollOut = this.Ernst_mc.onReleaseOutside = function() {

TweenMax.to(this, 0.3, {_xscale:100, _yscale:100, _rotation:0, ease:Bounce.easeOut});

};

 

this.Button_mc.onRelease = function() {

//trace("killing tweens");

TweenMax.killChildTweensOf(Holder,false);

};

Link to comment
Share on other sites

I think you're misunderstanding what killChildTweensOf() is supposed to do. It kills tweens that exist at the time you call the method - it does NOT prevent future tweens from being created.

 

You need to implement conditional logic of your own if you want to disallow tweens from being created in certain situations. Like have an "disableTweens" variable that you set to true when you want to keep the tweens from being created, and then you wrap your tween code in if (!disableTweens) conditional logic.

Link to comment
Share on other sites

Thanks for the advice, but I think killChildTweens is what i'm after. I'm trying to replicate exactly the site: www.amazing-academy.com. When you first visit the site a yellow post-it-note flies across the screen, all the background tweens are killed off until the user 'closes' the post-it note.. I'm happy to use conditional logic and think I can see how it could be done (global variable, few 'if's etc.)

Andy

Link to comment
Share on other sites

... no worries, got it working and thanks for pointing me in the right direction. I think killChildTweens kills tweens that are running whilst I call the 'killChildtweens' method - which is not what I'm after - you're right.

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...