0 Replies Latest reply on Oct 23, 2006 4:10 AM by Whitetimer

    Viewstacks & states

    Whitetimer Level 1
      Hi .... This is my main psge so far, and as you can see i have 7 components in my view stack. Each custom component will have several states for different pages for now. How can i write a function that when the LinkBar is clicked, the target component sets its state back to the base state. I also want to set any components such as combobox back to the first index everytime the page is viewed. So if a user clicks on another page and then clicks back to the the last page, the current state is the base state and any components (combobox) will be back to the first index.

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml"
      layout="vertical"
      backgroundGradientColors="[#b7b7ff, #ffffff]"
      verticalAlign="top" horizontalAlign="center"
      horizontalScrollPolicy="off"
      horizontalGap="5"
      xmlns:views="views.*">

      <mx:WipeLeft id="myLeft" duration="500" />
      <mx:WipeRight id="myRight" duration="500" />
      <mx:WipeDown id="myDown" duration="500" />


      <mx:Canvas
      height="200" width="900"
      y="5" backgroundImage="images/blueSand.jpg"

      borderStyle="solid"
      borderThickness="2"
      borderColor="#ffffff"
      shadowDistance="3"
      shadowDirection="right"
      dropShadowColor="#000000"
      dropShadowEnabled="true">

      <mx:Text
      x="250" y="141"
      text="Universal White Time Healing &amp; Teaching"
      color="#ffffff" fontFamily="Georgia" fontSize="34"/>

      </mx:Canvas>

      <mx:Canvas
      width="900" height="50"
      backgroundColor="#ffffff"
      borderStyle="solid"
      borderThickness="2"
      borderColor="#000066"
      shadowDistance="3"
      shadowDirection="right"
      dropShadowColor="#000000"
      dropShadowEnabled="true"
      verticalScrollPolicy="off"
      horizontalScrollPolicy="off" fontFamily="Georgia">

      <mx:LinkBar id="lbMain"
      dataProvider="vsMain"
      x="5" y="5" height="40"
      fontSize="12"
      textAlign="center"
      selectedIndex="0"
      barColor="#000080"
      verticalAlign="middle"
      horizontalAlign="center" color="#000080"/>

      <mx:Image x="836" y="0" width="50" height="50" source="images/Logo1.jpg"/>

      </mx:Canvas>

      <mx:Canvas
      width="900" height="600"
      backgroundColor="#ffffff"
      borderStyle="solid"
      borderThickness="2"
      borderColor="#000066"
      shadowDistance="3"
      shadowDirection="right"
      dropShadowColor="#000000"
      dropShadowEnabled="true">

      <mx:ViewStack x="10" y="10" id="vsMain" width="880" height="580">

      <views:vHome id="vHome" hideEffect="{myLeft}" showEffect="{myDown}"/>
      <views:vAbout id="vAbout" hideEffect="{myLeft}" showEffect="{myDown}"/>
      <views:vWhiteTime id="vWhiteTime" hideEffect="{myLeft}" showEffect="{myDown}"/>
      <views:vHealing id="vHealing" hideEffect="{myLeft}" showEffect="{myDown}"/>
      <views:vNewEarth id="vNewEarth" hideEffect="{myLeft}" showEffect="{myDown}"/>
      <views:vInfo id="vInfo" hideEffect="{myLeft}" showEffect="{myDown}"/>
      <views:vContact id="vContact" hideEffect="{myLeft}" showEffect="{myDown}"/>

      </mx:ViewStack>

      </mx:Canvas>

      <mx:Text text="Copyright 2006 UWTH - V 2.0" fontFamily="Georgia" fontSize="12" color="#000066"/>

      </mx:Application>

      Whitetimer