notjones
|
 |
« on: May 09, 2008, 08:47:45 » |
|
This issue is going to take some explanation.
First I have an application that uses dynamically loaded modules. To support this the main application mxml file contains a load module method that calls the currently loaded module and tells it it is going away, tells the main application's facade to remove core for the facade of the loaded module, sets the module loader's url to an empty string, finally sets the module loader's url to the new swf file. This appears to be working correctly and modules load as expected.
In the module where I'm having the problem, the your going away method does a remove core for the module's facade in an attempt to clear all of the facade related data.
With the above as background here's what is happening:
The loaded module (new doc panel) accepts data from the user then calls a proxy to post that data to a remote server. When the remote service call completes a notification is sent from the proxy. This works as expected.
User enters the module first time, files in the fields, and the new doc is sent to the server. Debug trace shows the proxy call is made and the completion notification received as expected.
The user then clicks in the menu to access the same module again. The app module load method follows the process described above and reloads the module. User enters new data for the second document and the proxy is called. Debug trace shows that the proxy is called once as expected, but the completion notification is received twice.
The user repeats the process, select the module from the menu, module loads again, user completes fields. Trace shows the proxy is called once as expected, but the completion notification is received three times.
Using debug and stepping through the code I can see that a new facade instance is being created for the module each time that it is being loaded. The question is where is the notification being stored so that it is firing multiple times? As it fires once for each time the module has been loaded I have no idea what is happening. Based on debug tracing I can only find the module in memory once. Is there something going on with PureMVC that is causing this?
Any ideas or help will be greatly appreciated.
|