CaueCR Posted March 18, 2014 Share Posted March 18, 2014 Hello again!I was trying to use a lot of tweens in some scenes of my game, and I wasn't able to find a way to stop the tweens.I've tried to set a flag to false to stop it from ending, But I found out the hard way that they wasn't actually stopping. When I started another tween, my object's coordinates were messed up because of the previous interruption of tweens.Is there a way to stop a tween in a way that it REALLY stops? I'd be very grateful if someone could answer this to me.(PS.: I've already found three other posts about it, but their solution (myTween.stop() doesn't work anymore, it seems) Thanks! Link to comment Share on other sites More sharing options...
CaueCR Posted March 18, 2014 Author Share Posted March 18, 2014 I've found my answer already. The problem was in the declaration of the tween://I was doing this:game.add.tween(blabla).to(bblablablabla).start().onComplete.add(function(){blablabla;});//When I should do this:tween1 = game.add.tween(blabla);tween1.to(bblablablabla).onComplete.add(function(){blablabla;});tween1.start();//then there's a way to do this:tween1.stop();I hope this will be useful to someone later.See ya! Link to comment Share on other sites More sharing options...
PadreMontoya Posted September 21, 2014 Share Posted September 21, 2014 I tried your solution but it wasn't working for me. Ultimately I had to go into the sprite's tween manager and stop each individual tween. This worked for me:tween.stop();for (var i in tween._manager._tweens){ tween._manager._tweens[i].stop();} Link to comment Share on other sites More sharing options...
Recommended Posts