i understand that this is likely due to garbage collection or something, but am unaware of what to do to fix it… here’s some code… help please, thanks…
this function creates a diamond shaped sprite, and then tweens it into view. once something else is clicked, the diamond is tweened off screen and then removechilded. and nulled. so when it’s clicked again it creates a new diamond and etc. etc… is there something wrong with my logic… ??
private function makeContent():void
{dia = drawDiamond();
dia.x = randomInRange(0, stage.stageWidth);
dia.y = randomInRange(stage.stageHeight*1.2, stage.stageHeight*1.4);
this.addChild(dia);
TweenMax.to(dia, 2, {x:stage.stageWidth*.3, y:stage.stageHeight*.2, ease:Elastic.easeIn, overwrite:2});
}
private function removeContent():void
{
TweenMax.to(dia, 5, {x:-1000, y:-1000, scaleX:.01, scaleY:.01, ease:Elastic.easeOut, overwrite:2, onComplete:contentcleanUp});
}
private function contentcleanUp():void
{
this.removeChild(dia);
}
by the way this post thread window is jacked up in my firefox… barely usable…