On Wed, Jan 7, 2009 at 4:48 AM, markgoldin_2000
<[email protected]> wrote:
> 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.

When you listen for an event on one of your ancestors, you usually
want to use a weak reference (the last parameter to addEventListener).
That's because your parent doesn't know you're listening on it, so
when you've been removed and "discarded", you'll still be around
because of the event listener.

Manish

Reply via email to