I'm using the JS version of greensock and I have an issue with an onComplete function being called when overwriting a tween and creating a new timelinelite instance.
So, effectively I create a number of tweens and add them to an array that I then parse into insertMultiple method of a TimelineLite instance.
I've tried killing the timelinelite timeline before creating a new one, but the onComplete function is still called. How do I prevent the onComplete function being called when overwriting/creating a new instance of the timelinelite?
for(var x = 0; x < 12; x++) {
if(has_children) {
m = c.getChildAt(x);
} else {
m = new createjs.Text();
m.x = (20*x);
c.addChild(m);
}
m.y = 0;
m.alpha = 1;
m.text = multiple * (x+1);
ta.push(TweenMax.from(m,0.5,{y:20,alpha:0,ease:Back.easeOut, overwrite:1}));
}
if(this._tl != null)
this._tl.kill();
this._tl = new TimelineLite({onComplete:function(){console.log("Hi");root._msg1.visible = root._msg2.visible = true; root._msg1.text("Here is the pattern for x times table.");root._msg2.text("This can be carried on to give more multiples of x")}});
this._tl.insertMultiple(ta,"0","start",0.1);