0 Replies Latest reply on Feb 21, 2008 2:13 PM by omb-shreyas

    ReferenceError: Though the variables have been defined

    omb-shreyas
      Scenario:
      Cairngorm framework used.
      The Application loads different modules at runtime on user selection.
      The Application and each of the modules has a seperate front controller.
      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 named ClassDeclarations.
      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
      quote:

      ReferenceError: Error #1065: Variable XXX is not defined.
      at global/flash.utils::getDefinitionByName()
      at...



      Observations:
      1. Now if the same ClassDeclarations are instantiated at the Application level, the one which loads the module, it magically works.
      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.