Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: Can i wait for async event to occur in a command class?  (Read 7757 times)
spacetimer
Jr. Member
**
Posts: 10


View Profile Email
« 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.
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 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>
Logged
spacetimer
Jr. Member
**
Posts: 10


View Profile Email
« Reply #2 on: August 08, 2010, 11:24:02 »

Got the point, thank you!
Logged
Pages: [1]
Print