Hello,

I finally decided to port an existing development towards the new
Modules architecture, and i am facing a pretty tough issue here.

I have a bunch of modules, that all extend BlockModule, which is a
Module subclass that itself implements the IBlockModule interface.
BlockModule and IBlockModule are in a library that the modules project
includes. 
Apparently, everything compiles fine, so far so good.

But now, in my application, I load these modules (using ModuleLoader),
and, when ready, try to set a "symbol" property on these modules.
Using the target property of the ModuleEvent, I correctly find the
modules. But, in order to be able to set the "symbol" property, I need
to cast them as IBlockModule.

And, that simply doesn't work.

Here is what my "ready" event listener looks like :


private function blockReady( pEvt:ModuleEvent ) : void
                        {
                              var ml:ModuleLoader = pEvt.target as ModuleLoader;
                              var block:IBlockModule = ml.child as IBlockModule;
                              trace (ml.child); // output is correct
                              trace (block); // null (apparently, the casting 
failed)
                              if( block != null) {
                                block.symbol = symbol;
                              }
                        }

>From what my googling tells me, I believe it might be an issue with
the shared library.... But I honestly have no clue of what precisely
(everything seems correct to me) nor of how I could solve this.

If anyone has an idea, i would love to hear it :)
cheers,
J.

Reply via email to