I want to use for next loop to reduce code for doing removechild()'s
I have working if (addChild(bmp1)) ----removeChild(bmp1). But I need to do it 20 times. I thought I could use a for/next loop, but so far can't seem to get it right.
for (var i:Number=0; i<21; I++)
{
my_bmp.name = "bmp" + 1;
if (addChild(my_bmp))
{
removeChild(my_bmp);
}
}
}
This code passing the compiler, but when I execute it I get "A term is undefined and has no properties". I'm thinking it has something to do with my_bmp.name? I've tried several things and just can't crack it.