1 Reply Latest reply on Dec 3, 2010 7:41 AM by kilo1981

    Animating State Transitions problem

    kilo1981

      Hi,

       

      I have a flex project with 3 states: loginState (contains panel called "login"), playState (contains panels called "playerPanel" and "adg1panel") and rateState (contains panels called "rateGridPanel" and "playerPanel"). I've done the related Flex in a Week tutorial and that works fine, however i'm having some trouble applying this to my own project. The transitions seem to work fine except for the two that start from the rateState (fromState=rateState).

       

      When these transitions occur the rateGridPanel seems to stay in place and all the other panels disappear. I've tried adding the <s:RemoveAction target="{rateGridPanel}"/>  and the related <s:AddAction targets.......> but they don't seem to make any difference.
      Any help would be greatly appreciated.... i've been at this for hours and it's starting to hurt my brain

       

       

      <!-- Code to handle transition animations -->

      <s:transitions>

       

      <s:Transition fromState="loginState" toState="playState">

       

      <s:Sequence>

       

      <s:Parallel targets="{[login, adg1panel, playerPanel]}">

       

      <s:Fade/>

       

      <s:Move target="{adg1panel}" yFrom="-200"/>

       

      <s:Move target="{playerPanel}" yFrom="1500"/>

       

      </s:Parallel>

       

      </s:Sequence>

       

      </s:Transition>

       

       

      <s:Transition fromState="playState" toState="loginState">

       

      <s:Sequence targets="{[login, adg1panel, playerPanel]}">

       

      <s:Fade/>

       

      <s:Move target="{adg1panel}"/>

       

      <s:Move target="{playerPanel}"/>

       

      </s:Sequence>

       

      </s:Transition>

       

       

      <s:Transition fromState="rateState" toState="loginState">

       

      <s:Sequence>

       

      <s:Parallel targets="{[login, rateGridPanel, playerPanel]}">

       

      <s:Fade/>

       

      <s:Move target="{rateGridPanel}" xTo="2000"/>

       

      <s:Move target="{playerPanel}" xTo="-200"/>

       

      <s:RemoveAction target="{rateGridPanel}"/>

       

      <s:Move target="{login}" yFrom="-200"/>

       

      </s:Parallel>

       

      </s:Sequence>

       

      </s:Transition>

       

       

      <s:Transition fromState="playState" toState="rateState">

       

      <s:Sequence>

       

      <s:AddAction target="{rateGridPanel}"/>

       

      <s:Parallel targets="{[adg1panel, rateGridPanel]}">

       

      <s:Fade/>

       

      <s:Move target="{rateGridPanel}" xFrom="2000"/>

       

      <s:RemoveAction target="{adg1panel}"/>

       

      </s:Parallel>

       

      </s:Sequence>

       

       

      </s:Transition>

       

       

      <s:Transition fromState="rateState" toState="playState">

       

      <s:Sequence>

       

      <s:AddAction target="{adg1panel}"/>

       

      <s:Parallel targets="{[adg1panel, rateGridPanel]}">

       

      <s:Fade target="{rateGridPanel}"/>

       

      <s:Move target="{adg1panel}" yFrom="-200"/>

       

      <s:RemoveAction target="{rateGridPanel}"/>

       

      </s:Parallel>

       

      </s:Sequence>

       

      </s:Transition>

      </s:transitions>

       

       

      <!-- Code relating to buttons -->

      <s:Button

       

      x="354" y="195" includeIn="playState" label="Rate Tunes" click="{currentState='rateState'}"/>

       

       

      <s:Button excludeFrom="loginState" x="354" y="236" label=" Log Out" width="84" click="{currentState='loginState'}"/>

       

       

      <s:Button x="354" y="195" includeIn="rateState" label="Play mode" click="{currentState='playState'}" x.rateState="354" y.rateState="195" width.rateState="84"/>

       

      <s:Button includeIn="loginState" x="39" y="136" label="Log In" click="{currentState='playState'}" />