1 Reply Latest reply on Aug 31, 2009 6:57 AM by kglad

    Tween Class Easing AS modification help.

    sherwin

      hi guys im new here in the forums, ive been searching around about tween class easing in as2 and ive found this great tutorial http://www.republicofcode.com/tutori...enclasseasing/

      i need a help though, im not really a actionscript programmer, but i wanted to modify this code:

      Code:
      import mx.transitions.Tween;
      import mx.transitions.easing.*;
      
      var myHoriTween:Tween = new Tween (myBall_mc,"_x",Strong.easeOut,0,400,2,true);
      
      myHoriTween.onMotionFinished = function (){
      }
      how would i modify the code so my objects not only goes on a straight line(_x like in the code from 0x to 400x),
      what if i wanted a diagonal direction, it will start in x and ends in y?

      hope you could show me how its done thanks in advance!!

        • 1. Re: Tween Class Easing AS modification help.
          kglad Adobe Community Professional & MVP

          to tween along a diagonal, tween both the _x and _y properties at the same time:

           



          Code:
          import mx.transitions.Tween;
          import mx.transitions.easing.*;

          var myHoriTween:Tween = new Tween (myBall_mc,"_x",Strong.easeOut,0,400,2,true);

          var myVertiTween:Tween = new Tween (myBall_mc,"_y",Strong.easeOut,0,400,2,true);
          myHoriTween.onMotionFinished = function (){ }

          if you want to tween the _x and then tween the _y, use:

           

          import mx.transitions.Tween;
          import mx.transitions.easing.*;

          var myHoriTween:Tween = new Tween (myBall_mc,"_x",Strong.easeOut,0,400,2,true);



          var myVertiTween:Tween

          myHoriTween.onMotionFinished = function (){
          myVertiTween = new Tween (myBall_mc,"_y",Strong.easeOut,0,400,2,true);


          }
          1 person found this helpful