I'm trying to remove MovieClip but it says Parameter child must be non-null.
This My Script:
To make it in stage, i use:
function sayam (e:MouseEvent):void{
nilai = 8;
if(nilai == temp) {
var ssAyam:ayam_mc = new ayam_mc
stage.addChild(ssAyam);
ssAyam.x = 350.0;
ssAyam.y = 330.0;
ssAyam.width = 170.0;
ssAyam.height = 170.0;
ssAyam.instanceName = "Ayam";
arnam.push("Ayam");
trace("arnam" +arnam);
trace(ssAyam.instanceName);
jual = jual + 4000;
temp = val[len-(len-len2)]
len2 = len2 + 1;
} else {
money = money - 4000;
}
}
So, i made 8 functions to make 8 movieclips to display in stage and push them to array. The Array is "arnam".
and this is my remove code:
function deleteBurger() {
for(var i:Number=arnam.length; i >= 0; i--){
removeChild(arnam[i]);
arnam.splice(i,1);
}
}
I've traced my array and it isn't null.
can anybody help me? thank you :)