2 Replies Latest reply on Dec 28, 2008 6:18 AM by Hulfy

    Easing with Flex

    jcahill23 Level 1
      Hi. I'm looking for a decent documentation/tute on "easing" in flex.
      I checked out the Flex dev guide and lang ref but if anyone knew of anything else that would be gr8.

      Thanks.
        • 1. Re: Easing with Flex
          Hulfy
          I looked for this and found very little. There is 2 ways you can do it

          (i) using mxml I would strongly adivse downloading 'tour de flex' and look under effects and also mx.effects.easing in the livedocs.

          (ii) Use a flash class like Tweener or Gtween, and include it in your build.

          After that you can do it with a single line.

          Tweener.addTween(myVbox1, {scaleY:1, time:2, transition:"easeOutBack"});

          You need to know a little actionscript for this.

          All the best
          • 2. Re: Easing with Flex
            Hulfy Level 1
            This is how to do it. There are lots of tweening enines out there but for this I am using tweener.

            -download tweener

            http://tweener.googlecode.com/files/tweener_1_31_74_as3.zip

            - create a folder on your destktop called Actionscripts and copy the unzipped folder (called caurina) into it.

            - in flex go to your project folder > properties >build path

            - for the source path you should choose you Actionscripts folder. *note*: all external classes should be put in this folder from now on and you can build up a library.

            in your script block in Flex you should create a tween like this, where showCase is the id of your element.



            <mx:Script>
            <![CDATA[


            import caurina.transitions.*;

            private function tweenIt():void
            {

            Tweener.addTween(showCase, {scaleY:4, time:2, transition:"easeOutBack"});


            }
            ]]>
            </mx:Script>

            call it with a button

            <mx:Button x="430" y="656" label="Button" click="tweenIt()"/>

            Look at the tweener cheat sheets and you can see all the various transition types you can use.