1 Reply Latest reply on Dec 14, 2009 12:41 PM by Flex harUI

    Interfaces

    grenvoy

      We have implemented an interface that extends Module.  It allows us to have a Parent application, and children applications that share commong functions inside of the parent.

       

      With this, we have a common Constants class.  It's nothing more then a large list of constants defined with "public static const".

       

      The problem is that we build the Parent, then later on we build the Child, but the child has a new constant string on the Constants class.  When we do this and try to pass the constant as a string to the parent, we get an error as shown below.  If I rebuild both at the same time, everything works fine.

       

      So my question is, with the interface and shared classes, is this constant string variable not passed as a string, and instead passed as an object reference?  I would have expected that the child would translate the class constant to a string before passing it to the parent.

       

       

       

      ------------------------------------------------------------------------------------------ ------------------------------------------------------------

       

      TypeError: Error #1009: Cannot access a property or method of a null object reference.
          at classes.stgdir.data::PermissionChecker/addPermissionRequest()[C:\Project\Multishuttle\Web Client\source\Flex\src\classes\stgdir\data\PermissionChecker.as:80]
          at StgDirFlexClient/addPermissionRequest()[C:\Project\Multishuttle\WebClient\source\Flex\src \StgDirFlexClient.mxml:146]
          at modules::TransactionsMain/onInit()[C:\Project\Multishuttle\WebClient\source\Flex\src\modu les\TransactionsMain.mxml:91]
          at modules::TransactionsMain/___TransactionsMain_MainGrid1_initialize()[C:\Project\Multishut tle\WebClient\source\Flex\src\modules\TransactionsMain.mxml:12]
          at flash.events::EventDispatcher/dispatchEventFunction()
          at flash.events::EventDispatcher/dispatchEvent()
          at mx.core::UIComponent/dispatchEvent()
          at mx.core::UIComponent/set processedDescriptors()
          at mx.core::Container/createComponentsFromDescriptors()
          at mx.core::Container/createChildren()
          at mx.core::UIComponent/initialize()
          at mx.core::Container/initialize()
          at modules::TransactionsMain/initialize()[C:\Project\Multishuttle\WebClient\source\Flex\src\ modules\TransactionsMain.mxml:0]
          at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded()
          at mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::childAdded()
          at mx.core::Container/addChildAt()
          at mx.core::Container/addChild()
          at StgDirFlexClient/moduleReadyHandler()[C:\Project\Multishuttle\WebClient\source\Flex\src\S tgDirFlexClient.mxml:252]
          at flash.events::EventDispatcher/dispatchEventFunction()
          at flash.events::EventDispatcher/dispatchEvent()
          at ModuleInfoProxy/moduleEventHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src \mx\modules\ModuleManager.as:1097]
          at flash.events::EventDispatcher/dispatchEventFunction()
          at flash.events::EventDispatcher/dispatchEvent()
          at ModuleInfo/readyHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\modules \ModuleManager.as:752]
          at flash.events::EventDispatcher/dispatchEventFunction()
          at flash.events::EventDispatcher/dispatchEvent()
          at mx.core::FlexModuleFactory/update()
          at mx.core::FlexModuleFactory/docFrameHandler()