1 Reply Latest reply on Dec 9, 2010 8:17 PM by Shongrunden

    Transitions is messed up the first time it runs

    nikos101 Level 2

      In the following code when the need to register button is pressed the transitions is messed up the first time it runs


      <?xml version="1.0" ?>
      <!-- transitions\LoginFormTransition.mxml -->
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
          <!-- The Application class states property defines the view states.-->
              <s:State name="default"/>   
              <s:State name="Register"/>
          <!-- Define the transition to animate the change of view state. -->
              <s:Transition fromState="default">
                      <mx:Resize target="{loginPanel}" duration="500"/>
                      <s:Wipe direction="right" target="{confirm}"/>
              <s:Transition fromState="Register">
                      <mx:Resize target="{loginPanel}" duration="100"/>
          <!-- Set title of the Panel container based on the view state.-->
          <s:Panel id="loginPanel"
                   title="Login" title.Register="Register">
              <mx:Form id="loginForm">
                  <mx:FormItem label="Username:">
                  <mx:FormItem label="Password:">
                  <!-- Add a TextInput control to the form for the Register view state. -->
                  <mx:FormItem id="confirm" label="Confirm:" includeIn="Register">
                      <s:TextInput id="myTI"/>
                  <mx:FormItem direction="horizontal" >
                      <!-- Use the LinkButton to change to the Register view state.-->
                      <!-- Exclude the LinkButton from the Register view state.-->   
                      <!-- Add a LinkButton to the form for the Register view state. -->
                      <mx:LinkButton label="Return to Login"
                      <mx:Spacer width="100%" id="spacer1"/>
                      <!-- Set label of the control based on the view state.-->
                      <mx:LinkButton id="registerLink"
                                     label="Need to Register?"
                      <s:Button id="loginButton"
                                label="Login" label.Register="Register"/>