I’ve created a for loop that adds random circles to the stage when you’re in frame 5. That works just fine. I’ve been trying for hours to get rid of the circles that the for loop creates when I goto another frame. I can’t for the life of me get rid of them. THis is the code I have and it’s not working for me. Any help would be GREATLY appreciated.
[AS]
if(currentFrame == 5)
{
for (var i:Number = 0; i < 35; i++)
{
var Container:MovieClip = new MovieClip;
var spec:Spec = new Spec();
spec.x = Math.random() * stage.stageWidth / 2;
spec.y = Math.random() * stage.stageHeight / 2;
spec.alpha = Math.random();
addChild(Container);
Container.addChild(spec);
}
}
if(currentFrame != 5)
{
removeChild(Container.spec);
}
[/AS]