Share Posted November 12, 2012 Hi I would like to kill the ThrowPropsPlugin when the user click on a button. Couldn't find in the API document http://www.greensock.com/as/docs/tween/com/greensock/plugins/ThrowPropsPlugin.html Just wondering is there a way you work it around? Thanks Link to comment Share on other sites More sharing options...
Share Posted November 13, 2012 Hi. //Set up your tween like so: var myThrowTween:TweenLite = TweenLite.to(mc, 2, {throwProps:{x:500, y:-300}}); //when you need to kill it myThrowTween.kill() // or TweenLite.killTweensOf(mc); You can just use the kill-related methods that TweenLite and TweenMax provide. They will work the same regardless of whether or not ThrowProps is involved. Let us know if you need any more help. Link to comment Share on other sites More sharing options...
Author Share Posted November 13, 2012 Hi Carl, Thanks for your quick reply u always very helpful. ThrowPropsPlugin.to(_panelContainer.mc_productContainer, {throwProps:{ y:{ velocity:yVelocity, max:25, min: -(_panelContainer.mc_productContainer.height - _MINIHEIGHT), resistance:50 } },onUpdate : function(){ _scrollBar.y = -(_botScroll/_yOverlap * (_panelContainer.mc_productContainer.y - 25 )); checkPosition(_panelContainer.mc_productContainer.y); }, ease:Strong.easeOut }, 5, 0.3, 1); How do i kill it in this situation? Link to comment Share on other sites More sharing options...
Share Posted November 13, 2012 Ah, thanks for the clarification. Take a peak at the ThrowProps.to() method signature: public static function to(target:Object, vars:Object, maxDuration:Number = 100, minDuration:Number = 0.25, overshootTolerance:Number = 1):TweenLite Since to() returns a TweenLite you should be able to do this: var myThrowTween:TweenLite = ThrowPropsPlugin.to(_panelContainer.mc_productContainer, {throwProps:{ y:{ velocity:yVelocity, max:25, min: -(_panelContainer.mc_productContainer.height - _MINIHEIGHT), resistance:50 } },onUpdate : function(){ _scrollBar.y = -(_botScroll/_yOverlap * (_panelContainer.mc_productContainer.y - 25 )); checkPosition(_panelContainer.mc_productContainer.y); }, ease:Strong.easeOut }, 5, 0.3, 1); and then to kill, same as before: myThrowTween.kill() // or TweenLite.killTweensOf(_panelContainer.mc_productContainer); That should work fine. Pleasure to help you. -c Link to comment Share on other sites More sharing options...
Author Share Posted November 13, 2012 Wow thanks very much Carl 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