Bruno,
a classe Tween possui alguns eventos que você pode controlar da mesma maneira que controla um evento de tela (ex. MouseEvent, etc).
Um desses eventos avisa quando a animação terminar; ele se chama motionFinish. Dê uma olhada no help para ver as opções.
Segue abaixo uma modificação no código que inclui listeners para o evento motionFinish:
CÓDIGO
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
new Tween(alvo1_mc, "x", Strong.easeOut, 0 - alvo1_mc.width, stage.stageWidth/2 - alvo1_mc.width/2, 4, true);
alvo1_mc.addEventListener(MouseEvent.CLICK, alvoUmclickHandler);
alvo2_mc.addEventListener(MouseEvent.CLICK, alvoDoisclickHandler);
alvo3_mc.addEventListener(MouseEvent.CLICK, alvoTresclickHandler);
function alvoUmclickHandler(e:MouseEvent):void {
var tween:Tween = new Tween(alvo1_mc, "x", Strong.easeOut, stage.stageWidth/2 - alvo1_mc.width/2, stage.stageWidth + alvo1_mc.width, 4, true);
tween.addEventListener(TweenEvent.MOTION_FINISH, tween1Finished);
}
function alvoDoisclickHandler(e:MouseEvent):void {
var tween:Tween = new Tween(alvo2_mc, "x", Strong.easeOut, stage.stageWidth/2 - alvo2_mc.width/2, stage.stageWidth + alvo2_mc.width, 4, true);
tween.addEventListener(TweenEvent.MOTION_FINISH, tween2Finished);
}
function alvoTresclickHandler(e:MouseEvent):void {
var tween:Tween = new Tween(alvo3_mc, "x", Strong.easeOut, stage.stageWidth/2 - alvo3_mc.width/2, stage.stageWidth + alvo3_mc.width, 4, true);
tween.addEventListener(TweenEvent.MOTION_FINISH, tween3Finished);
}
function tween1Finished(e:TweenEvent):void {
new Tween(alvo2_mc, "x", Strong.easeOut, 0 - alvo2_mc.width, stage.stageWidth/2 - alvo2_mc.width/2, 4, true);
}
function tween2Finished(e:TweenEvent):void {
new Tween(alvo3_mc, "x", Strong.easeOut, 0 - alvo3_mc.width, stage.stageWidth/2 - alvo3_mc.width/2, 4, true);
}
function tween3Finished(e:TweenEvent):void {
new Tween(alvo1_mc, "x", Strong.easeOut, 0 - alvo1_mc.width, stage.stageWidth/2 - alvo1_mc.width/2, 4, true);
}
att
João Motondon