Adding multiple instances of the same object The movie clip disappears from the first object because the instance name is Always the same is there a solution
var mc1:Mc1=new Mc1();
var mc2:Mc2=new Mc2();
var ar:Array=new Array();
function fun(){
var i = 0;
while (i < ar.length) {
ar[i].width=864;
ar[i].height=651;
ar[i].x=200;
ar[i].y=200;
ar[i].visible=false;
addChild(ar[i]);
i++;
}
TweenMax.staggerTo(ar,0, {visible:true},0.120);
}
button1.addEventListener(MouseEvent.CLICK,f1);
function f1(e:Event):void{
ar.push(mc1);//
}
button2.addEventListener(MouseEvent.CLICK,f2);
function f2(e:Event):void{
ar.push(mc2);
}
button3.addEventListener(MouseEvent.CLICK,f3);
function f3(e:Event):void{
ar.push(mc1);//
}
button4.addEventListener(MouseEvent.CLICK,f4);
function f4(e:Event):void{
fun();
}