1 Reply Latest reply on Jul 5, 2006 10:45 AM by ntsiii

    Access ViewStack declared in main app from sub apps

    meticoolus Level 1
      I have two sub applications defined in main application.I have put them inside ViewStack,so that only the desired sub application is rendered,
      code is
      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.macromedia.com/2003/mxml" xmlns="*" initialize="loadme();" >

      <mx:Script>
      <![CDATA[
      function loadme()
      {
      signview1.selectedChild= sign;
      }

      function callme()
      {
      insertion.text=foo.sn_freeid.text;
      }

      function callHim()
      {
      signview1.selectedChild= wel;
      }
      ]]>
      </mx:Script>

      <mx:ViewStack textAlign="center" id="signview1" >

      <mx:VBox id="sign">
      <signinVS id="foo"/>
      </mx:VBox>

      <mx:VBox id="wel">s
      <welcomeVS id="coo"/>
      </mx:VBox>

      </mx:ViewStack>

      <mx:Label id="insertion" />

      <mx:Button label="press me" click="callme();"/>
      <mx:Button label="call Him" click="callHim();"/>

      </mx:Application>

      I have two sub application signinVS and welcomeVS. On page load I can render signinVS as defined in loadme() function in code.
      The requirement is on button press inside sub application(signinVS),I want to load welcomeVS and vice versa.Since ViewStack is declared inside main application,I could not able to read ViewStack id inside sub application.Is there some way to fix this problem.Pls help.
      Thanks in advance