14 Replies Latest reply on May 9, 2009 5:21 PM by Ned Murphy

    rotate a mc 360º in 45º 'smooth' steps with buttons left & right

    DevPas

      Hi everyone,

       

      I thought it should be easy.

       

      I have a circular mc (wheel2) and this should rotate 'smooth' in steps of 45º, to the left and to the right (buttons).

       

      The script I use on the button (right);

       

      on(release){
      var rotate:Function = function (obj:MovieClip) {
      obj._rotation += 3;
      if (obj._rotation == 45) {
      clearInterval(interval);
      }
      };
      var interval:Number = setInterval(rotate, 10, wheel2);
      stop();
      }

       

      It moves ok 'once' then it spins 360º. Should I set a new value for my mc??

       

      Thanks

       

      pascal