Scenario: Cairngorm framework used.
The Application loads different modules at runtime on user
The Application and each of the modules has a seperate front
One of the module it loads is using getDefinitionByName()[In
the command through the controller] to instantiate an object at
runtime. The class it is trying to instantiate has been imported
along with other dynamically instantiable classes in a seperate AS
This ClassDeclaration is instantiated at the Module so that
the references of the dynamic classes are available and compiler
includes the same in the swf.
Problem: But this doesnt work. It gives an
ReferenceError: Error #1065: Variable XXX is not defined.
Observations: 1. Now if the same ClassDeclarations are instantiated at the
Application level, the one which loads the module, it magically
2. When the module is loaded, and the event is dispatched,
the front controller of the module is able to route the event to
its command properly.
Questions: I wonder why? and what is the difference it makes to put the
ClassDeclarations at Application level than at the module level?
Since the classes in ClassDeclaration are used only by the module,
it is not making sense to to put it at the Application level and
increase the App size.