views:

2818

answers:

1

I'm trying to create a simple wipe / slide type transition between 2 states. Similiar to the way the iphone 'slides' from one list to another (ie. inbox > mail listing)

I can't seem to figure out or find correct documentation on how to do this using 2 simple canvas components and transitions where one slides off screen to the left as the other slides in from the right.

I've got the second state 'sliding in' with the following code, but how can I modify to simultaneously 'slide out' the first?

<mx:transitions>
 <mx:Transition fromState="summaryState" toState="detailState">
 <mx:Parallel target="{contentCanvas}">
  <mx:WipeLeft duration="300"/>
 </mx:Parallel>
 </mx:Transition>
</mx:transitions>

Thanks in advance.

A: 

On Adobe's site, they mention you should use the and set the 'fromState' and 'toState' (you may use '*' to define the states). I'm assuming that your 2 simple canvas components are each in its own state? If so once you set the transition, it should be able to play out your effect. Also the linked site mentions that effects can be played in sequence or in parallel which may be needed to get the effect you want.

EDIT:

I did a small test and this was what I came up with. It seems to work in my tests as both canvas were animated. I'm assuming you are using setCurrentState("newState", true). I hope this is what you are asking for.

<mx:transitions>
  <mx:Transition fromState="FirstState" toState="SecondState">
    <mx:Parallel>
      <mx:WipeLeft target="{CanvasA}" duration="300"/>
      <mx:WipeRight target="{CanvasB}" duration="300"/>
    </mx:Parallel>
  </mx:Transition>
</mx:transitions>

Further EDIT: This may be useful as well. I think what you'll need to do is, have both canvas be in one of the state and then execute it. Perhaps you'll need to re-arrange your states a little so that both canvas are in the one state which at the moment I assume you have kept them in separate states.

nevets1219
I didn't realize that my code sample wasn't showing up until I just read your reply. I edited it to display. I guess my question is still how to get the first state to slide away left as the second state slides in right in parallel.
WillyCornbread
This was very helpful - to get the effect i wanted I did indeed need to use a true effect and play it using move effects rather then wipes.
WillyCornbread