I´m trying to build my flex modular app, and got the following scenario
Portal (which includes, 2 modules:) -Mod1 (.swf) -Mod2 (.swf)
Also, i have Mod1-API (.swc)
The Mod1-API, defines interfaces which are implemented on the Mod1 (.swf). Both the Mod1 and Mod2 swfs import the Mod1-API swc.
I´m trying to call the API method on the Mod2. On Mod2 I´ve the interface, since it is shared via the Mod1-API project.
What I´m trying to achieve is the real implementation class loading on Mod2, via reflection, using the getDefinitionByName method, but it says its not defined.
So, is there a way to achieve it?
I mean, how from the mod2 load开发者_如何学Python a class that is on the Mod1 project, returning just the interfacce to the mod2 so it can call methods just like an ordinary API method?
It depends on where you are loading your class definitions. Flex uses both Security Domains and Application Domains to partition code which has been loaded.
If you want Module 2 to access code loaded via Module 1, they need to be loaded into both the same security and application domains.
This should give you a good start.
精彩评论