--- In [email protected], "boy_trike" <[EMAIL PROTECTED]> wrote:
>
> I change my state to "X" and have a removeChild statement to remove
a datagrid (since
> something else will take its place). My question is how can I have
an effect play instead of
> just having it disappear. It seems like my RemoveChild statement
is played before any
> transition is played.
>
> Thanks
>
> Bruce
>
this is an example from "inside RIA. the transition worked for me.
but i could not get the second state to render it's components.
you can try this method though the author uses cairngorm, but that
does not matter, since this is the view part. hope it helps
=====================================================================
<mx:states>
<mx:State name="{BookieModel.SIGNED_OUT}">
<mx:AddChild>
<view:SignInPanel id="signInPanel"
horizontalAlign="center" verticalAlign="middle" />
</mx:AddChild>
</mx:State>
<mx:State name="{BookieModel.SIGNED_IN}">
<mx:RemoveChild id="removeSignInPanel"
target="{signInPanel}" />
<mx:AddChild>
<mx:Panel layout="horizontal"
title="Find a Book" width="100%" height="100%" id="masterPanel"
status="{'Welcome, ' + model.user.firstName + ' ' +
model.user.lastName}" creationCompleteEffect="{wipeIn}">
<mx:HDividedBox width="100%"
height="100%" liveDragging="true">
<view:BookList
id="bookList" width="100%" height="100%" />
<mx:VDividedBox
id="searchBox" width="100%" liveDragging="true" height="100%">
<mx:TabNavigator id="searchMethods" height="100%"
width="100%">
<search:TitleSearch id="titleSearch" label="Search by Title"
bookSearch="searchBooks(event)" />
<search:AuthorSearch id="authorSearch" label="Search by
Author" bookSearch="searchBooks(event)" />
<search:SubjectSearch id="subjectSearch" label="Search by
Subject" bookSearch="searchBooks(event)" />
</mx:TabNavigator>
</mx:VDividedBox>
</mx:HDividedBox>
<mx:ControlBar
horizontalAlign="right">
<mx:Button
id="signOutButton" label="Sign Out" click="signOut()" />
</mx:ControlBar>
</mx:Panel>
</mx:AddChild>
</mx:State>
<mx:State name="{BookieModel.BOOKS_CHOSEN}"
basedOn="{BookieModel.SIGNED_IN}">
<mx:AddChild relativeTo="{searchBox}"
position="lastChild">
<view:ReserveBooksPanel
id="reserveList" />
</mx:AddChild>
<mx:SetProperty target="{searchMethods}"
name="height" value="55%"/>
<mx:SetProperty target="{reserveList}"
name="height" value="45%"/>
</mx:State>
</mx:states>
<mx:transitions>
<mx:Transition id="fadeSignInOut"
fromState="{BookieModel.SIGNED_OUT}"
toState="{BookieModel.SIGNED_IN}">
<mx:Sequence>
<mx:Move target="{signInPanel}"
xTo="5000" duration="2000" />
<mx:RemoveChildAction
target="{signInPanel}" />
<mx:AddChildAction
target="{masterPanel}" />
</mx:Sequence>
</mx:Transition>
</mx:transitions>
====================================================================