1 Reply Latest reply on Jan 5, 2011 9:06 AM by Gregory Lafrance

    Flex 4:  does removing a compoent also remove children?

    learner_doug Level 1

      I have an application that loads and unloads components via  addEelement() and removeElement() methods.  Each component has a number of children objects and code associated with it.  Does removeElement() remove all the children of that component?

      Thanks.

        • 1. Re: Flex 4:  does removing a compoent also remove children?
          Gregory Lafrance Level 6

          Nope. removeElement just removed that component from the display list. The removed component and all its children still exist. They won't be visible, but they will exist in memory.

           

          If you are concerned about garbage collection, you might be able to set the removed component to null, and as long as nothing else has a reference to it or any of its children, including outstanding event listeners that need to be removed, you should be okay.

           

          If this post answers your question or helps, please mark it as such. Thanks!

          http://www.stardustsystems.com
          Adobe Flex Development and Support Services