----- Original Message -----
From: "markgoldin_2000" <[email protected]>
To: <[email protected]>
Sent: Thursday, January 08, 2009 7:12 PM
Subject: [flexcoders] Release a child .... again
> Still cannot get it work.
> Here is my scenario:
>
> 1. Container adds child1 to itself.
> 2. Container adds child2 to itself.
> Child2 adds a custom event listener to parent (Container):
> parent.addEventListener("remoteDateEvent", remoteClickHandler,
> false, 0, true);
> 3. Child1 dispatches a custom event:
> private function executeRun(event:KeyboardEvent):void
> {
> if(event.charCode == 13)
> {
> var eventObj:remoteDateRun = new remoteDateRun("remoteDateEvent");
> dispatchEvent(eventObj);
> }
> }
> 4. Child2 handles custom event:
> public function remoteClickHandler(event:remoteDateRun):void
> {
> runDate = event.runDate;
> dailyJobSumaryList(lineId);
> }
> At this point everything works.
> Now, after some user action both forms are removed form the Container
> and all previous steps are repeated.
> At this point everything still works.
> Now user is going back to his initial selection. Both forms are
> removed again and 3rd set of forms is added to the Container. At this
> point if a child1 dispatches a custom event then child2 form set #1
> will get it to handle. Can someone please just put step by step
> instruction how to make sure that a form is released and collected?
> I have spent days if not more trying to fix the problem.
Be better if you can make a complete example. You say that child2 handles
the event, yet you also say you add the event handler to the parent
container, nor do you show any code to remove the handlers or the children.
Paul
> Thanks in advance.