Sure, this is possible, Im doing it right now
you just have to use Sequence in your transition
here is mine
<mx:Transition fromState="{fromLobbyState}" toState="gameLayout">
<mx:Sequence id="gameTransition" duration="300"
effectStart="trace('\n\n GANGE STATE: from lobbyLayout to gameLayout
\n\n')">
<mx:Pause duration="5000" effectStart="trace('PAUSE 1')"/>
<mx:Parallel id="lobbyOut" effectStart="trace('parallel
1')">
<mx:AnimateProperty target="{titleBar}" property="alpha"
fromValue="1" toValue="0" startDelay="{initDelay}"/>
<mx:AnimateProperty target="{asistantBar}"
property="alpha" fromValue="1" toValue="0" startDelay="{initDelay + 1 *
animInterval}"/>
</mx:Parallel>
<mx:Pause duration="5000" effectStart="trace('PAUSE 1')"/>
<mx:Parallel effectStart="trace('parallel 2')">
<mx:RemoveChildAction target="{titleBar}"/>
<mx:RemoveChildAction target="{asistantBar}"/>
</mx:Parallel>
<mx:Parallel duration="300" effectStart="trace('parallel
3')" effectEnd="gameContent.loadGame()">
<mx:AddChildAction target="{titleBar2}"
startDelay="{initDelay}"/>
<mx:AnimateProperty target="{titleBar2}"
property="alpha" fromValue="0" toValue="1" startDelay="{initDelay}"/>
<mx:AddChildAction target="{asistantBar2}"
startDelay="{initDelay + 1 * animInterval}"/>
<mx:AnimateProperty target="{asistantBar2}"
property="alpha" fromValue="0" toValue="1" startDelay="{initDelay + 1 *
animInterval}"/>
</mx:Parallel>
</mx:Sequence>
</mx:Transition>
Hope this helps...
BUT I HAVE ANOTHER PROBLEM
as you said transition are played after changing state, because on screen
all seems ok, if I add at the start 5 sec PAUSE, it just waits 5 sec and
then all is playing. But Im listening at FlexEvent.ADD, and
FlexEvent.REMOVEof this components which are changing...and they
dispatch ADD + REMOVE
before transition (as if state was done) and there after PAUSE they dispatch
once more REMOVE event (just now component goes out of screen). So visually
all is correct, but I have to do something on ADD, REMOVE events, and this
is bugged or Im missing something...
Can someone help me?
--
.:Franto:.
http://blog.franto.com
http://www.flashcoders.sk
http://www.carcassonne.sk
On 15/03/07, Troy Gilbert <[EMAIL PROTECTED]> wrote:
I'm dabbling with states and transitions for the first time, so pardon
the inexperienced question...
My UI is logically divided into "pages" like a traditional wizard
interface. Visually, I'd like my pages to slide in and out of view as I
transition to them. Specifically, you can think of it like all of the
pages are in a horizontal scroll box, so when I go from page 1 to page 3 I
want to scroll page 1 to the left, page 2 to the left and scroll page 3 into
view from the right. And then if I want to go from page 3 back to page 1, I
want to do the reverse: scroll page 3 out of view to the right, scroll page
2 from left to right into and outof the view, and finally scroll page 1 from
the left into the view. This would all be continously of course.
The big thing that's tripping me up is the order in which state changes
occur. The impression I'm getting is that the actions for a state (like
AddChild, RemoveChild, SetPropertyValue) are executed *then* the
transition is applied. The problem is that I can't figure out how to apply
transition effects to my "outgoing" objects.
For example, consider two pages, #1 and #2. My base state has both pages
hidden. I then have two states each with one of the pages visible. If I have
a transition from state 1 to state 2, page #1 is hidden, then the
transition plays. But I want the transition to include page 1 (sliding it
out of view).
My question: is it possible to execute a transition on the current
state*before* the new
state becomes active, then play a transition on the new state... and
better yet, is it possible to apply the settings for the new state,
perform the transitions, then remove the previous states changes?
Part of me thinks I really need some generalized "scroller" control to
contain my pages, but my gut tells me that states/transitions/effects should
give me all the tools I need to accomplish this. And since I only have 5-6
states total, I'm cool with having to hardcode a certain number of
transitions (left to right, right to left, etc.).
Thanks,
Troy.