2 Replies Latest reply on Sep 20, 2011 6:03 AM by Romain Gi.

    Class cast exception between child modules

    Romain Gi. Level 1

      Hi folks,

      I’m new in Flex and ActionScript. I would like realize the following use case:

      Context:

      -          2 modules with Tab navigator.

      -          1 main application without Tab navigator.

      Scenario:

      1.       I load my first child module with the following commands:

      var moduleInfo:IModuleInfo=ModuleManager.getModule(path2PresentationModule);

      moduleInfo.load(new ApplicationDomain(ApplicationDomain.currentDomain), null, null, _moduleFactory);

      2.       On module ready event I display the Tab within the child module 1

      3.       I load my second child module with the following command:

      var moduleInfo:IModuleInfo=ModuleManager.getModule(path2PresentationModule);

      moduleInfo.load(new ApplicationDomain(ApplicationDomain.currentDomain), null, null, _moduleFactory);

      4.       On module ready event I display the Tab within the child module 2

      5.       Then it crash with the following error stack:

      Stack error:

       

      TypeError: Error #1034: Type Coercion failed: cannot convert mx.managers::HistoryManagerImpl@4d004e1 to mx.managers.IHistoryManager.

            at mx.managers::HistoryManager$/get impl()

            at mx.managers::HistoryManager$/register()

            at mx.containers::ViewStack/commitProperties()

            at mx.containers::TabNavigator/commitProperties()

            at mx.core::UIComponent/validateProperties()[E:\dev\4.5.1\frameworks\projects\framework\src\ mx\core\UIComponent.as:8209]

            at mx.managers::LayoutManager/validateProperties()[E:\dev\4.5.1\frameworks\projects\framewor k\src\mx\managers\LayoutManager.as:597]

            at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.5.1\frameworks\projects\frame work\src\mx\managers\LayoutManager.as:813]

            at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.5.1\frameworks\projec ts\framework\src\mx\managers\LayoutManager.as:1180]

      Do you have any idea to save me !

      Thanks,

      Romain.