1 Reply Latest reply on Aug 6, 2008 9:12 AM by Newsgroup_User

    ViewStack and Module errors

    Smart_flex
      I have read couple of posts/presentations regarding Modules..But still I am not able to figure out the issue..hey You can call me dummy here... I really appreciate if anyone can help me out here.

      I am getting ReferenceError: Error #1069: Property child not found on MyApp and there is no default value.
      at HomePageView/loadChildView()

      Here is the code: [When I click 'childView' button in HomePageView module, I want ChildPageView to be loaded.]

      MyApp.mxml

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" xmlns="*" creationComplete="initApp()">
      <mx:Script>
      <![CDATA[
      private function initApp():void {
      module1.applicationDomain = ApplicationDomain.currentDomain;
      module1.url="Module1.swf";
      }
      ]]>
      </mx:Script>
      <mx:ViewStack id="myAppViewStack" width="100%" height="100%" >
      <mx:ModuleLoader id="module1" width="100%" height="100%" />
      <mx:ModuleLoader id="module2" width="100%" height="100%" />
      <mx:ModuleLoader id="module3" width="100%" height="100%" />
      </mx:ViewStack>
      </mx:Application>

      Module1.mxml

      <mx:Module xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" width="100%" height="100%" xmlns="*" creationComplete="initApp()">
      <mx:ViewStack id="module1ViewStack" borderStyle="solid" width="100%" height="100%" >
      <mx:ModuleLoader id="home" width="100%" height="100%" />
      <mx:ModuleLoader id="child" width="100%" height="100%" />
      </mx:ViewStack>
      <mx:Script>
      <![CDATA[
      private function initApp():void {
      home.applicationDomain = ApplicationDomain.currentDomain;
      home.url="HomePageView.swf";
      }
      ]]>
      </mx:Script>
      </mx:Module>

      HomePageView.mxml

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Module xmlns:mx=" http://www.adobe.com/2006/mxml" width="100%" height="100%">
      <mx:Script>
      <![CDATA[
      import mx.core.Application;
      private function loadChildView(){
      Application.application.child.applicationDomain = ApplicationDomain.currentDomain;
      Application.application.child.url="ChildPageView.swf";
      }
      ]]>
      </mx:Script>
      <mx:Button label="Child View" click="loadChildView()" />
      </mx:Module>
      Text Text
        • 1. Re: ViewStack and Module errors
          Level 7

          "Smart_flex" <webforumsuser@macromedia.com> wrote in message
          news:g7cfa2$pgo$1@forums.macromedia.com...
          >I have read couple of posts/presentations regarding Modules..But still I am
          >not
          > able to figure out the issue..hey You can call me dummy here... I really
          > appreciate if anyone can help me out here.
          >
          > I am getting ReferenceError: Error #1069: Property child not found on
          > MyApp
          > and there is no default value.
          > at HomePageView/loadChildView()
          >
          > Here is the code: [When I click 'childView' button in HomePageView module,
          > I
          > want ChildPageView to be loaded.]

          http://blogs.adobe.com/flexdoc/pdfs/modular.pdf
          Look at page 35