2 Replies Latest reply on May 16, 2011 6:09 PM by Vishalsood.77

    Module issue with Burrito(SDK Hero)

    Vishalsood.77 Level 1

      hi,

       

      when i try to add a module to the main application it always show an error.

       

      TypeError: Error #1009: Cannot access a property or method of a null object reference.

      at mx.core::UIComponent/getStyle()[E:\dev\hero_private\frameworks\projects\framework\src\mx\ core\UIComponent.as:11055]

      at mx.styles::StyleProtoChain$/setStyle()[E:\dev\hero_private\frameworks\projects\framework\ src\mx\styles\StyleProtoChain.as:688]

      at mx.core::UIComponent/setStyle()[E:\dev\hero_private\frameworks\projects\framework\src\mx\ core\UIComponent.as:11081]

      at spark.skins.spark::BorderContainerSkin/updateDisplayList()[E:\dev\hero_private\frameworks \projects\spark\src\spark\skins\spark\BorderContainerSkin.as:158]

      at mx.core::UIComponent/validateDisplayList()[E:\dev\hero_private\frameworks\projects\framew ork\src\mx\core\UIComponent.as:8951]

      at spark.components::Group/validateDisplayList()[E:\dev\hero_private\frameworks\projects\spa rk\src\spark\components\Group.as:1027]

      at mx.managers::LayoutManager/validateDisplayList()[E:\dev\hero_private\frameworks\projects\ framework\src\mx\managers\LayoutManager.as:736]

      at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\hero_private\frameworks\project s\framework\src\mx\managers\LayoutManager.as:801]

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

       

      i try all combinations, but not succeed.

      Please help me.

       

      This is a simple Module.

       

      <?xml version="1.0" encoding="utf-8"?>

      <mx:Module xmlns:fx="http://ns.adobe.com/mxml/2009"

         xmlns:s="library://ns.adobe.com/flex/spark"

         xmlns:mx="library://ns.adobe.com/flex/mx" width="400" height="300">

      <fx:Declarations>

      <!-- Place non-visual elements (e.g., services, value objects) here -->

      </fx:Declarations>

      <s:BorderContainer left="2" right="2" top="2" bottom="2">

      <s:BorderContainer x="19" y="253" width="357" height="31">

      </s:BorderContainer>

      </s:BorderContainer>

       

      </mx:Module>

       

       

      How i add in my application

       

      <?xml version="1.0" encoding="utf-8"?>

      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

         xmlns:s="library://ns.adobe.com/flex/spark"

         xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">

        <fx:Script>

           <![CDATA[

                import mx.events.ModuleEvent;

                private var mod:sample;

                protected function modLoader_readyHandler(event:ModuleEvent):void

                {

                     // TODO Auto-generated method stub.

                     mod = modLoader.child as sample;

                }

       

           ]]>

        </fx:Script>

        <fx:Declarations>

           <!-- Place non-visual elements (e.g., services, value objects) here -->

        </fx:Declarations>

        <mx:ModuleLoader id="modLoader" url="sample.swf" ready="modLoader_readyHandler(event)" />

      </s:Application>