----- Original Message ----- From: "markgoldin_2000" <markgoldin_2...@yahoo.com> To: <flexcoders@yahoogroups.com> Sent: Wednesday, January 07, 2009 2:04 PM Subject: [flexcoders] Re: Properly remove children
> It is set to true. Did not help. Could there be something else pointing to the child/form? > --- In flexcoders@yahoogroups.com, "Sam Lai" <samuel....@...> wrote: >> >> I think you need to use weak references when adding event listeners. >> Set the last parameter of addEventListener to true when adding event >> listeners. >> >> Alternately, you can remove event listeners when the forms are > removed >> using the removeEventListener function. >> >> The flex profiler is useful here too to see what's not being > garbage collected.. >> >> 2009/1/7 markgoldin_2000 <markgoldin_2...@...>: >> > Ok, here what I am getting. >> > I have a container that I am adding different forms to at the run >> > time. These forms are all based on the same class though. >> > So, before I add a new form I am removing current form using: >> > container.removeAllChildren(); >> > each form when created is adding a custom event listener to a > parent - >> > the container. When a custom event is triggered every form that > was >> > created (regardless that it was removed after) gets this custom > event >> > to handle. >> > >> > >> > --- In flexcoders@yahoogroups.com, "Manish Jethani" >> > <manish.jethani@> wrote: >> >> >> >> On Wed, Jan 7, 2009 at 4:23 AM, markgoldin_2000 >> >> <markgoldin_2000@> wrote: >> >> >>removeAllChildren >> >> > Yes, that's what I use but I dont see objects being completely >> >> > destroyed. >> >> >> >> Define "destroyed". >> >> >> >> Surely you see them go away? >> >> >> >> Manish