PureMVC Architects Lounge

Announcements and General Discussion => Getting Started => Topic started by: spacetimer on August 06, 2010, 12:10:29



Title: Can i wait for async event to occur in a command class?
Post by: spacetimer on August 06, 2010, 12:10:29
Hi,
   For example I want to load a module in a command. So I registered ModuleEvent.READY to a handler in the same command class as its private function. But I learned that the command object is "instant" which means that it'll be destroyed after the excute finishes.


Title: Re: Can i wait for async event to occur in a command class?
Post by: puremvc on August 06, 2010, 07:32:27
If you have set a method of the command as an event listener (unless you used a weak reference), then the command will still exist after the execute is done, because there is a reference to it (in the list of listeners for the object you did addListener on).

-=Cliff>


Title: Re: Can i wait for async event to occur in a command class?
Post by: spacetimer on August 08, 2010, 11:24:02
Got the point, thank you!