Bruce,

 

The answer is yes, although it takes some playing with to get it right J  here is an example of a fading transition.  The key here is the RemoveChildAction effect and the AddChildAction effect in the transition.  These allow you to control when the RemoveChild and AddChild state changes happen.   You should be able to adapt this to your example.

 

<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"

            currentState="vb1">

           

            <mx:states>

                        <mx:State name="vb1">

                                    <mx:RemoveChild target="{vb2}" />

                        </mx:State>

                        <mx:State name="vb2">

                                    <mx:RemoveChild target="{vb1}" />

                        </mx:State>

            </mx:states>

           

            <mx:transitions>

                        <mx:Transition toState="vb1" fromState="*">

                                    <mx:Sequence>

                                                <mx:Fade target="{vb2}" alphaFrom="1" alphaTo="0" />

                                                <mx:RemoveChildAction target="{vb2}" />

                                                <mx:AddChildAction target="{vb1}" />

                                                <mx:Fade target="{vb1}" alphaFrom="0" alphaTo="1" />

                                    </mx:Sequence>

                        </mx:Transition>

                        <mx:Transition toState="vb2" fromState="*">

                                    <mx:Sequence>

                                                <mx:Fade target="{vb1}" alphaFrom="1" alphaTo="0" />

                                                <mx:RemoveChildAction target="{vb1}" />

                                                <mx:AddChildAction target="{vb2}" />

                                                <mx:Fade target="{vb2}" alphaFrom="0" alphaTo="1" />

                                    </mx:Sequence>

                        </mx:Transition>

            </mx:transitions>

           

            <mx:Button label="Change State" top="10" left="10" click="currentState = currentState == 'vb1'?'vb2':'vb1';" />

           

            <mx:VBox id="vb1" top="44" bottom="10" right="10" left="10" backgroundColor="0xFFFFFF" borderStyle="solid">

                       

            </mx:VBox>

            <mx:VBox id="vb2" top="44" bottom="10" right="10" left="10" backgroundColor="0x333333" borderStyle="solid">

                       

            </mx:VBox>

           

</mx:Application>

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Bruce Denham
Sent: Sunday, November 05, 2006 9:22 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Can a Transition be used for addedEffect / removedEffect?

 

I'm not finding any documented examples and something like this
doesn't seem to work for me:

<mx:states>
<mx:State name="ShowForm">
<mx:SetProperty name="visible" value="false"
target="{mypanel1}"/>
<mx:RemoveChild target="{mypanel1}"/>
<mx:AddChild position="lastChild">
<ns1:NewPanel1 addedEffect="{myFade}"
id="newPanel1" x="10" y="10" width="288" height="433" title="Outline">
<mx:ControlBar height="40">
</mx:ControlBar>
</ns1:NewPanel1>
</mx:AddChild>
......

<mx:Transition id="myFade">
<mx:Sequence>
<mx:Fade alphaFrom="0" alphaTo="1"
duration="600" />
</mx:Sequence>
</mx:Transition>

Thanks,
Bruce

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to