Copy link to clipboard
Copied
butt.addEventListener (MouseEvent.MOUSE_UP, makeMC); var mc1:MovieClip = new MYMC(); function makeMC (event:MouseEvent):void { if (clipAdded) { // same as if (clipAdded == true) removeChildAt(numChildren - 1); // last one added } addChild (mc1); clipAdded = true; mc1.x = += 100; mc1.y = 300; mc1.play(); clipAdded = true; } removeChildAt(numChildren - 1); } } var clipAdded:Boolean = false; /*function Child (mc1){ clipAdded = true; }*/
Your posted code is a mess... in any case, within it the following might be where the problem lies...
mc1.x = += 100;
it's either = or += but it cannot be both
Copy link to clipboard
Copied
Your posted code is a mess... in any case, within it the following might be where the problem lies...
mc1.x = += 100;
it's either = or += but it cannot be both
Find more inspiration, events, and resources on the new Adobe Community
Explore Now