Put those classes in an RSL or module and load it into the main app domain.
See the "shared code" module in the examples with the modules post on my
i try , but when i put chart inside module, it won't render, not displays.
Check out the modules presentation on my blog. You can pre-load some
classes (the ones that are being shared) then the sub-apps can load after
and share those classes. In the blog post I show how to do it for modules,
but the technique will work for sub-apps too.
Flex SDK Team
Adobe System, Inc.
i am using now modules as you said, but there is big problem with passing parameters using query String and read from loaderInfo, when i am loading two the same modules with diferent parameters, querry string is exactly the same, why? i have noticed that i have this problem only when i load modules using :
var applicationDomain:ApplicationDomain = ApplicationDomain.currentDomain;
singleModuleInfo.load(); passing parameteres with querryString works fine
but i need ues applicationDomain cos i have problem with bug in modules with IStroke in area chart
so normal i have following error:
Error #1034: Type Coercion failed:
cannot convert mx.graphics::Stroke@205c5d61 to mx.graphics.IStroke
and when i use applicationDomain this problem disapeares, but now i have problem with passing query string in two the same modules, any help?
1 person found this helpful
Because a module only gets loaded once, and the factory generates multiple
instances. Instead of using url params, set properties on the factory'd
Thanks for Your replay, any sugestion or example how to do it?
Hopefully before you maybe loaded the subapp via
And code somewhere in the Application checked parameters.foo and set foo
private function checkFoo():void
foo = parameters.foo;
Now you just load the module once w/o parameters
private var modInfo:IModuleInfo = ModuleManager.getModule("module.swf");
And once the module is ready:
var module1:IMyModuleInterface = modInfo.factory.create();
module1.foo = 1;
var module2:IMyModuleInterface = modInfo.factory.create();
module2.foo = 2;
I am complatyly not getting your way of thinkng, i done it another way, i have created interface and each module impelemnts it. Then when i load some module i cast them on this interface and load some function which this interface implements.