Thank you for your advice. I did that, but I have no idea what i am
looking at. As you can see, I have no references to the modules from the
main application so I still have no idea why its throwing that error.
Where can I find more information on how to read it?
On 8/4/2010 5:16 PM, Alex Harui wrote:
Use a link-report to make sure none of the classes in the module are
being liked into the main app. Lots of folks have been doing things like:
Var myModule:MyModule = MyModule(moduleInfo.factory.create()
Instead of using an interface. This actually links MyModule into the
main app, defeating the purpose of modules, and in Flex 4, will mess
up the style lookup.
On 8/4/10 4:24 AM, "Wally Kolcz" <[email protected]
<[email protected]>> wrote:
Just kidding..kinda.. After googling a lot of combination of
terms, I
was able to finally get some answers regarding problems that seem to
come up while trying to develop a modular application, but, sadly,
I am
not 100% sure what the Adobe person was talking about. The error
always
centers around the mysterious error: 'ArgumentError: Error #2004:
One of
the parameters is invalid. at
flash.display::Graphics/drawRoundRect()...'
More often than not it revolves around a <s:Button> but I just got
the
same error on a layout that has no buttons. This time it seems to
revolve this time be a <s:BorderContainer> since when I swapped it
out
from a <s:Group> (which worked fine) it started throwing errors.
My question to the group is how to manage loading Modules from the
application and not throw errors? Why does this happen when it
never did
it in 3.4. I read it has to do with Style references with the main
application, but, again, I don't know exactly what that means or
how to
fix it.
Since it seems to come up in the other posts I could find, I have an
Application that, based on a log in and the user's 'accountType',
loads
a modules for that user's portal type. I use this to load the
modules,
which seems to be pretty stock, and it works fine for the loading and
adding of different modules throughout the application.:
private function loadModule(path:String):void {
modLoader = ModuleManager.getModule(path);
modLoader.addEventListener(ModuleEvent.ERROR,
modErrorHandler);
modLoader.addEventListener(ModuleEvent.READY,
modReadyHandler);
modLoader.load();
}
private function modErrorHandler(e:ModuleEvent):void {
Alert.show("Module did not load correctly", "Module
Loading Error");
}
private function modReadyHandler(e:ModuleEvent):void {
this.removeAllElements();
this.addElement(modLoader.factory.create() as
IVisualElement);
}
Any ideas why I get that error when loading modules? How can I fix
it?
Does ANYONE know why that error is thrown?
--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui <http://blogs.adobe.com/aharui>