Problem:
I have module that implements my interface:
{
...
}
After loading module from external file:
moduleInfo.addEventListener(ModuleEvent.READY, this_READY );
moduleInfo.load(null,null,null ,FlexGlobals.topLevelApplication.moduleFactory);
And creating module object:
var moduleInfo:IModuleInfo = moduleEvent.module;
var m:Object = moduleInfo.factory.create();
}
The expression:
returns false instead of true.
Solution:
The solution for this problem is following:
After creating the module object using factory, we must use the expression presented above. I do not know why, but after the first use of this expression or casting (operator as) it behaves right.
Therefore we must add the following line:
var moduleInfo:IModuleInfo = moduleEvent.module;
var m:Object = moduleInfo.factory.create();
m is IMyInterface;
}
It looks like error in Flex for me, as I cannot find an explanation for it.