2 Replies Latest reply on Aug 19, 2009 2:35 PM by Chet Haase

    Best transition to achieve slide-open effect?

    Handycam Level 1

      In my app I have two states and a setup like:

       

      VGroup

           HGroup

              SimpleText1

              Button1

           /HGroup

           SimpleText2

      /VGroup

       

      SimpleText2 is set to be included only in State2.  Button1 toggles the state between State1 and State2, thereby showing and hiding SimpleText2.  This causes the VGroup to expand and collapse to show the additional text object.  Perfect.

       

      However, I want to smooth out the resize, so that the VGroup more slowly slides open then the text appears.

       

      I already can fade in the text with:

       

       

           <s:transitions>
                <s:Transition fromState="State1" toState="State2">
                    <s:Parallel target="{SimpleText2}">
                         <s:Fade duration="1000"/>
                    </s:Parallel>
                </s:Transition>
           </s:transitions>
      

       

       

      But what transition can I apply to the VGroup?

        • 1. Re: Best transition to achieve slide-open effect?
          Handycam Level 1

          OK, Resize.  The problem I am now having is when I do it in a sequence, initially the text object is 100% opaque as the resize happens, then does its fade.

           

           

               <s:transitions>
                    <s:Transition fromState="state1" toState="state2">
                         <s:Sequence>
                             <s:Resize duration="500" target="{vgroup}" />
                             <s:Fade duration="500" target="{text}" />
                         </s:Sequence>
                    </s:Transition>
                    <s:Transition fromState="state2" toState="state1">
                         <s:Sequence>
                             <s:Fade duration="500" target="{text}" />
                             <s:Resize duration="500" target="{vgroup}" />
                         </s:Sequence>
                    </s:Transition>
               </s:transitions>
          
          • 2. Re: Best transition to achieve slide-open effect?
            Chet Haase Level 3

            There is some logic build into Fade to do the right thing in situations like this, but it currently works better with Parallel (with startDelay) than with Sequence. It's a bug on my plate...

             

            In the meantime, put an AddAction effect after the Resize - this should delay adding the object until after the Resize finishes. You can also experiment with SetAction to set initial alpha properties, but AddAction should do it.

             

            Chet.