I'm working in Flash CS6 with Adobe AIR 3.3 and having trouble deleting movie clips after I have added them to the stage. Here's my code:
for(var i = 0; i<starCount; i++)
{
star = new newStar();
choiceBoard.addChild(star);
star.x = 195;
if(i>=1)
{
star.x = 195 + 90*i;
}
star.y = 597
}
This is part of a function I've created that adds star shaped movie clips dynamically...It adds a movie clip, adds space between, adds the next movie clip etc. How can I delete all the star movie clips after they are created?
I've tried:
for(var i = 0; i<starCount; i++)
{
if(contains(star))
{
choiceBoard.removeChild(star);
trace("removed star");
}
}
But this only deletes one star, regardless what "starCount" is set to. Thanks in advance.