4 Replies Latest reply on Nov 15, 2007 4:38 AM by atta707

    Quick Question about fade effect

    Kamal_Hylton
      Quick Question:

      If I wanted to add a Fade Effect from one state to another when a button is pressed.

      How would I do that within the code?
        • 1. Re: Quick Question about fade effect
          leoalvesmachado
          I belive the Getting Started part of the FlexBuilder Help has something about it...
          Look at lessons->Use view State and transitions->Create a transition
          • 2. Re: Quick Question about fade effect
            atta707 Level 2
            You can do something like on the click of the button:

            var fader:Fade = new Fade(targetUIComponent);
            fader.duration = 1000;
            fader...;
            fader.play();

            or listen for currentStateChanging event and write the same similar code.

            or define transitions from one state to another like:
            <mx:Transition id="toOneOnly" fromState="*" toState="OneOnly">
            <mx:Sequence id="t1" targets="{[p2]}">
            <mx:Iris showTarget="false" duration="350"/>
            <mx:SetPropertyAction name="visible"/>
            <mx:SetPropertyAction target="{p2}" name="includeInLayout"/>
            </mx:Sequence>
            </mx:Transition>

            • 3. Re: Quick Question about fade effect
              Kamal_Hylton Level 1
              quote:

              Originally posted by: atta707
              You can do something like on the click of the button:

              var fader:Fade = new Fade(targetUIComponent);
              fader.duration = 1000;
              fader...;
              fader.play();

              or listen for currentStateChanging event and write the same similar code.

              or define transitions from one state to another like:
              <mx:Transition id="toOneOnly" fromState="*" toState="OneOnly">
              <mx:Sequence id="t1" targets="{[p2]}">
              <mx:Iris showTarget="false" duration="350"/>
              <mx:SetPropertyAction name="visible"/>
              <mx:SetPropertyAction target="{p2}" name="includeInLayout"/>
              </mx:Sequence>
              </mx:Transition>




              Hey,

              I would like to use the "transition from one state to another", but if you can explain each part for me that would be helpful.

              If you can comment on each line of that code that would help

              thanks
              • 4. Re: Quick Question about fade effect
                atta707 Level 2
                I think docs do a much better job at explaining transitions with examples that I can ever do on this forum!

                You can start here:
                http://livedocs.adobe.com/labs/flex3/html/help.html?content=transitions_03.html


                ATTA