2 Replies Latest reply on Apr 4, 2011 6:55 PM by Rodri___

    Can't replicate inversed "sequence" when coding showEffect


      Hi people,


      I need to code both hideEffect and showEffect to be shown when selecting different elements in a ViewStack.

      For the showEffect, I need container to appear in a minimal size from the middle of the screen until it reaches its full size.

      For the hideEffect, I need the exact opposite of that: to decrease the size of the container until it reaches a minimal size.


      The alpha in both effects should change also (but that's a future problem)


      I got the hideEffect covered with this:

      <s:Scale id="hideEffect"
              scaleXFrom="1" scaleXTo="0.1"
           scaleYFrom="1" scaleYTo="0.1"

      This makes the container disappear by decreasing its size.


      I am having trouble with the showEffect.

      If I put this:


      <s:Scale id="showEffect"
              scaleXFrom="0.1" scaleXTo="1"
           scaleYFrom="0.1" scaleYTo="1"


      Or this:

      <s:Animate id="showEffect">
                  <s:SimpleMotionPath property="x" valueFrom="512" valueTo="0"/>
                  <s:SimpleMotionPath property="y" valueFrom="384" valueTo="0"/>
                  <s:SimpleMotionPath property="scaleX" valueFrom="0.1" valueTo="1"/>
                  <s:SimpleMotionPath property="scaleY" valueFrom="0.1" valueTo="1"/>


      The container appears from the upper left corner of the screen. I guess this has to do with the fact that the container doesn't know which its final "center".

      That is why I tried the second solution, but with no luck.

      If I only set the "x" and "y" properties in the Animate effect, the container appears in the middle and moves towards the (0,0) coordinates. But when I add the scaleX and scaleY properties, the container is first shown in the middle (for a veeeeeeeeeeeeeeeeery brief moment) but then appears in (0,0) and it increases size from there.


      Can anyone shed a light on this?