I dont really have a name (myButton). Objects are added to a 
container at run-time.

--- In [email protected], "Manish Jethani" 
<manish.jeth...@...> wrote:
>
> On Wed, Jan 7, 2009 at 12:22 AM, markgoldin_2000
> <markgoldin_2...@...> wrote:
> > How do I remove children from a container in order to completely
> > destroy them? Will removeAllChildren do the job?
> 
> To remove an object visually, you'll have to remove it from the
> "display list" by calling removeChild or removeChildAt on its 
parent.
> 
> Your code might still have references to the object. To really make
> sure that the object is no longer accessible and therefore eligible
> for garbage collection, you'll have to release all references to it.
> For example, if a variable myButton which is a private member of 
your
> Applciation points to a Button instance you create somewhere, you'll
> have to null out that reference.
> 
>   someContainer.removeChild(myButton);
>   myButton = null;
> 
> Manish
>


Reply via email to