I'm thinking it is because you are trying to create a new applicationdomain, look at the blog above, I'm not sure if you are trying to do the same thing. I'm not sure why you are trying to create a new domain too. But, the above blog might answer your question.
I want to use "new ApplicationDomain()" because i use a class with same name to another that the main application use, but the implementation is different.
I tried the example "ApplicationDomainExample.2.as" at "http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/system/Applicatio nDomain.html#includeExamplesSummary"
and not work for me.
The example in the link is trying to load a SWF(Not module) using Loader and get a class out of the SWF. the code you have posted is trying to load a Module(SWF though). so, please research a little further on this. As far as I know, i do not think what ever you are trying to do will work for module loader, modules have to be handled differently.
You would never access the class of the module from the main application, so, you dont even have to implement the logic which was given in the example
link. All you do loading the modules is, 1) load module 2) add it as an element to this container / store it at a global place and call methods on it using module interface.
In all the process above mentioned, I would not even consider if the file names are same/different in the actual application / the module.
I have a main application that loads multiple modules. The main application and the modules uses the same library project, but in diferent version.
I never try to access to a class in the module, forget the link in the previous post.
Suppose the main application use a class "UserVO" and the module use "UserVO" but with different implementation
Pd: sorry my bad inglish
See this page on loading modules using ModuleManager. You can specify the ApplicationDomain.
If this post answers your question or helps, please mark it as such. Thanks!
Adobe Flex Development and Support Services
Then you dont worry about which class the module/application is trying to use, because the module is now compiled with a different version of the uservo and the main application is loaded with a different type of userVo. Did you try without the application domain and let the appilcation and module load their own uservo/swc library?
If i dont use a separate application domain, when the main application start, it register in the current domain the class of the UserVO , when later i load the module it detect the existence of a UserVO class ("same package and class name") register and use that class.
1 person found this helpful
Modules must be loaded into the same or child applicationDomain. That's why
there is a parameter when you load the module. You cannot specify a sibling
applicationDomain. To load different versions of classes, you have to use
the Marshall Plan configurations.