Share Posted August 19, 2015 Hi, I have big problem with killing The problem: 1. I have 5 functions fired one by one with "onComplete". 2. I need to kill any tweens from this functions in any time, and it works properly when I kill any of these functions for the first time. 3. It doesn't work properly when I fired these functions and try too kill one again. 4. It does look like "the killing machine" remember position of myElement when the first "kill" was fired and move in a blink myElement to this position, then of course kill the tween. Should I clear something or maybe something else? Best Regards Link to post Share on other sites
Share Posted August 19, 2015 Hi and welcome to the GreenSock forums. Yeah it's a bit unclear what you're trying to do. The first thing that comes to my mind is that perhaps you could try to clear any initialization data the Tween instance could have, for that you can use invalidate(): http://greensock.com/docs/#/HTML5/GSAP/TweenLite/invalidate/ Using that method you can kill the instance, then invalidate it and finally restart it or create it again. var t = TweenLite.to(elem, 1, {vars, onComplete:myFunc}); function myFunc(){ // some code here } // then kill and invalidate the tween // keep in mind that most GSAP methods return the same instance // like that you can chain them t.kill().invalidate(); Another option is to set the time or progress of the tween to 0 before killing it, that will force the initial render state of the element: var t = TweenLite.to(elem, 1, {vars, onComplete: myFunc}); function myFunc(){ // code here } // then kill the instance // using time t.pause(0).kill(); // using seek t.seek(0).kill(); // using progress t.progress(0).kill(); FInally, please take a look at this thread to learn how to create a reduced sample using codepen, that usually reduces support time dramatically, since it allows us to see the real issue and tinkering with whatever code you're using: http://greensock.com/forums/topic/9002-read-this-first-how-to-create-a-codepen-demo/ 2 Link to post Share on other sites
Author Solution Share Posted August 20, 2015 Thanks for your answer Rodrigo. I will use the codepen in the future, sorry for confusion Probably I missed the point with my animation, 'cos I mixed timeline with not-timeline animation. Now everything is ok, as always with GSAP! You guys are the best Link to post Share on other sites