I think your problem belongs data typing. You are having Module A in Base Class data type and re initiating with Module B in Sub Class of Base Class. This will definitely leads to type coercion error. While loading module B u can type cast as Base Class itself. After loading, when ever u want to use any of properties and methods you can re-cast to sub class type.
Doing by this, you may not have this kind of error. Hope it will help you. Sathis On Tue, Jul 5, 2011 at 2:47 PM, Shalu <[email protected]> wrote: > hi Jonathan, > > To remove modules from memory, remove all event listeners associated > with Module, Remove children, use weakReferences and after unloading > the module, assign null value to it. > > check below links for your reference: > > http://www.tink.ws/blog/flex-4-modules/ > > http://blogs.adobe.com/aharui/2009/08/what_we_know_about_unloading_m.html > > Hope this resolves your module unloading problem. > > -Shalu > > On Jul 5, 2:10 am, Jonathan W <[email protected]> wrote: > > Hi everyone. > > > > I'm seeking some Cairngorm help. I'm using Cairngorm in an Application > > that uses a ModuleLoader. It seems I'm having trouble somewhere with > > Cairngorm model-view binding. > > > > I have Modules being loaded that are bound to a variable in the > > ModelLocator. > > > > Let's say this variable is of type BaseClass > > And Module A gets loaded and binds to it. > > > > I then unload the module and reinstantiate the variable in the model > > to a subclass of the BaseClass. I want to load another Module B that > > binds to that SubClass, but it crashes saying > > > > Type Coercion failed: cannot convert BaseClass to SubClass in Module > > A.mxml. > > > > It seems as if the old module is still there somewhere. Any ideas how > > to unload the module properly so that I can change the variable in the > > model? > > > > Thanks in advance. > > -- > You received this message because you are subscribed to the Google Groups > "Flex India Community" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/flex_india?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Flex India Community" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/flex_india?hl=en.

