[RESOLVED] removeChild problem
Actionscript Code:
function btnClicked(e:MouseEvent):void {
switch (e.target) {
case Aplayer1 :
setChildIndex(Aplayer1,numChildren - 1);
TweenMax.to(Aplayer1, 0.5, {x:159, y:266, scaleX:1, scaleY:1, colorTransform:{tint:0x000000, tintAmount:0}});
this.addChild(infoA1);
infoA1.x = 126;
infoA1.y = 389;
//here i want to remove the movieclip that loaded from others buttonclicked
this.removeChild(infoA3);
this.removeChild(infoA2);
this.removeChild(infoA4);
break;
case Aplayer2 :
setChildIndex(Aplayer2,numChildren - 1);
TweenMax.to(Aplayer2, 0.5, {x:253, y:268, scaleX:1, scaleY:1, colorTransform:{tint:0x000000, tintAmount:0}});
this.addChild(infoA2);
infoA2.x = 126;
infoA2.y = 389;
break;
case Aplayer3 :
setChildIndex(Aplayer3,numChildren - 1);
TweenMax.to(Aplayer3, 0.5, {x:364, y:264, scaleX:1, scaleY:1, colorTransform:{tint:0x000000, tintAmount:0}});
this.addChild(infoA3);
infoA3.x = 126;
infoA3.y = 389;
break;
case Aplayer4 :
setChildIndex(Aplayer4,numChildren - 1);
TweenMax.to(Aplayer4, 0.5, {x:506, y:274, scaleX:1, scaleY:1, colorTransform:{tint:0x000000, tintAmount:0}});
this.addChild(infoA4);
infoA4.x = 126;
infoA4.y = 389;
break;
}
}
When i click Aplayer1 it will load infoA1 movieclip to the stage, click on Aplayer2 will load infoA2...but it will overlapping infoA1,infoA2...
i try to remove the child with the script above it will show up error 2025.
how to resolve this problem?