Hi all,
I have 3 MCs (my_mc0, my_mc1 and my_mc2) on my stage. And I need to apply the same motion tween on them.
So, follow the script that I’ve tried to do it:
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
var nav_array:Array = new Array("Home", "About", "Info");
for (var i:int=0; i<nav_array.length; i++) {
var objeto = this["my_mc"+i];
objeto.navText.text = nav_array*;
var efeito = "x";
var anima = Strong.easeInOut;
var pos_ini = objeto.x;
var pos_fin = objeto.x+200;
}
var myTween = new Tween(objeto, efeito, anima, pos_ini,pos_fin, 1, true);
myTween.stop();
objeto.addEventListener(MouseEvent.CLICK, onClick);
function onClick(e:MouseEvent):void {
myTween.start();
trace(objeto.name);
}
However, only the last MC (my_mc2) is working properly (when I click on it, the motion tween runs). Moreover, the output window only displays “my_mc2”, and disregards the other MovieClips.
What is wrong in my code?
Thanks for any help!