4 Replies Latest reply on Jan 6, 2014 11:14 AM by elainecc

    Change speed of animation using code

    Eddie Ostrowski Level 2
      • Created an animation for a rectangle that either goes up or down.
      • Is it possible to change the speed of the rectangle only when it is going up by using code?
      • Below, is the code for the button:

       

       

      if(sym.getComposition().getStage().getSymbol("rect").upDown == 0){

      sym.getComposition().getStage().getSymbol("rect").upDown = 1;

      sym.getComposition().getStage().getSymbol("rect").playReverse();

      }

      else{

      sym.getComposition().getStage().getSymbol("rect").upDown = 0;

      sym.getComposition().getStage().getSymbol("rect").play();

      }

       

       

       

      Thanks,

      Eddie