1 Reply Latest reply on Jan 18, 2010 8:28 AM by kiran7881

    Flex 3 :Help needed in implementing View States

    kiran7881 Level 1

      I am new to Flex , i am trying to understand View States , tried for one hour but got confused .
      (Basically by seeing the examples i understood the concept , but failed to implement ) 
      Please help .
      Assume my requirement is at the load of the page , i want to show an Login Button and a Chnage State Button (common button) only .and when the Change State button is clicked on ,i want to show the Register Button .
      So for this i made two Forms , and a common button .


             <mx:Form id="RegForm">
                  <mx:Button label="RegFormButton" id="RegFormButton"/>
              <mx:Form id="loginForm">
                          <mx:Button label="LoginButton" id="loginButton"/>


      <!-- A common button for both the States-->
        <mx:Button label="Change State"

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

      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" currentState="Register">
      <mx:State name="Register">         
      <mx:SetProperty   target="RegForm"   value="Register"/>

      <mx:State name="loginForm">
      <mx:SetProperty   target="loginForm"   value="Login"/>



      ( I think some how i can write the Logic to chnage to the current state to loginForm when user clicks with some inline code , but please tell me At the start of the page please tell me why I am not able to show the Register.