Jump to content
GreenSock

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

How to kill ThrowPropsPlugin

Recommended Posts

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

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

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

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