2 Replies Latest reply on Jun 14, 2006 10:30 PM by theodren_1983

    animation speed

    theodren_1983
      I've got an issue with an embedded movie clip. It is a spinning cylinder that I need to be able to speed up and slow down. There are 100 frames of animation that it runs through. I've tried creating a loop that basically says
      onClipEvent(mousedown) {


      for(x=0;x<100;x++){
      nextFrame();


      }
      }
      so that when they click it should run through one frame at a time until x=100. it does it instantly though, so I need a way to slow the process down so that I can simulate the cylinder being spun quickly and then gradually slowing down.
      Any ideas? Thanks heaps in advance

      Btw, I'm using flash mx professional 2004, if that makes a difference
        • 1. Re: animation speed
          tay_shk Level 1
          Try this,


          onClipEvent(mouseDown){
          count=1;
          myint=setInterval(function(){
          gotoAndStop(count);
          count++;
          if(count==100){
          clearInterval(myint)
          }
          },50)
          }

          //write stop on first frame of your movieclip , to adjust speed of your movie increase or decrease value in place of 50,
          • 2. Re: animation speed
            theodren_1983 Level 1
            onClipEvent(load) {
            stop();
            x=1 //Frame counter
            counter=1 //loop counter
            y=1 //Increment counter
            }



            onClipEvent (enterFrame) {

            gotoAndStop(x)

            x=x+y
            if(x>100){
            x=1
            counter=counter+1

            if(counter==8){
            y=y-1;
            trace(y);
            counter=1;

            }
            gotoAndStop(x)
            }

            }

            ended up getting it to work with this, will try the set interval though, thanks heaps :)