Question

I want to change a movieclip.text during a tween.

I got this function, can I change the information on this movieclip when this Tween is happening?

function facaTween(m:MovieClip){
   TweenLite.to(m,1,{rotationX:360,ease:Strong.easeInOut}); 
   }

when I tryed this code the as3 changes the information before the tween happens and i want during the tween.

facaTween(hue.obs);
hue.obs.text = "HAHAH";
Was it helpful?

Solution

You can update text in any time, when you want, TweenLite is powerful:

  • onComplete - change text after tween complete
  • onStart - change text at start, right before start

Example:

TweenLite.to(m,1,{rotationX:360, onComplete:onFinish, onStart: onBegin, ease:Strong.easeInOut});

function onFinish():void{
    hue.obs.text ="Complete";
}
function onBegin():void{
    hue.obs.text = "Start";
}

During, you mean with small delay? You can change text a bit after you start tween:

TweenLite.delayedCall(0.2, onSmallDelay);

function onSmallDelay():void{
    hue.obs.text = "text after 200ms";
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top