Share Posted September 27, 2013 If ThrowPropsPlugin.to tween is in progress and a TweenLite.to is triggered the ThrowProps onComplete never runs. what happens to the first tween? Is it still using resorces or do i need to/can I, kill it with TweenLite.killTweensOf or something else that i'm not seeing? ThrowPropsPlugin.to(target, {throwProps:{x:{velocity:movment, min:xValue, max:xValue}},ease:Strong.easeOut,onComplete:tpend},1,.5); if(target.x < 0) { TweenLite.to(target, .5, {x:-600,onComplete:onOffStage, onCompleteParams:[target]}); } Thanks a lot, B Link to comment Share on other sites More sharing options...
Share Posted September 28, 2013 Good question. Regardless of whether or not throwProps is involved, whenever 2 tweens compete for control over the same properties of the same object a decision needs to be made on how that conflict will be handled. GSAP has a variety of overwrite modes which allow you to specify which tweens should be prioritized and which ones should be killed. The default mode is auto: auto: when the tween renders for the first time, it will analyze tweens of the same target that are currently active/running and only overwrite individual tweening properties that overlap/conflict. Tweens that haven't begun yet are ignored. For example, if another active tween is found that is tweening 3 properties, only 1 of which it shares in common with the new tween, the other 2 properties will be left alone. Only the conflicting property gets overwritten/killed. This is the default mode and typically the most intuitive for developers. read about all modes in TweenLite docs under Special Properties: http://api.greensock.com/js/com/greensock/TweenLite.html In your case, both tweens are tweening the x property. When the TweenLite tween starts it realizes that another tween is controlling the x of target. Since the TweenLite tween is the most recent tween created, the decision is made that it should not only control the x value of target, but the ThrowProps tween is killed. The throwProps tween stops immediately and is made eligible for garbage collection. It will never complete. 2 Link to comment Share on other sites More sharing options...
Author Share Posted September 28, 2013 Carl, I am glad to hear that TweenLite handles this situation gracefully. I assumed this probably the case. Thank you for your response. B 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