2 Replies Latest reply: Jul 15, 2011 7:23 AM by kennethkawamoto2 RSS

    How to change Movieclip frameRate ?

    Kirubakaran Srinivasan Community Member

      Hi

       

      Here is my problem that i have a movieClip. i want to change my frameRate without changing another instances.

       

      Basically stage frameRate should be same but my movieClip frameRate has to be changed as per my choice ?

      Is that possible or what ?

      If so please give me the solution.

        • 1. Re: How to change Movieclip frameRate ?
          dmeN Community Member

          You can't alter the frame rate of a clip, though you can pretty much fake it using a timer. You just tell the clip to stop, and then peiodically tell it to go nextFrame... Since the timer is ms based, if you call it at 100 ms intervals, you get 10 fps. If you use 33 ms you'd get 30 fps. etc.

           

          myClip.stop();
          var t:Timer = new Timer(33);
          t.addEventListener(TimerEvent.TIMER, update);
          t.start();

           

          function update(e:TimerEvent):void
          {
              myClip.nextFrame();
              if(myClip.currentFrame >= myClip.totalFrames){
                  myClip.gotoAndStop(1);
              }
          }

          • 2. Re: How to change Movieclip frameRate ?
            kennethkawamoto2 CommunityMVP

            You can make a MovieClip run slower, for example if you tell it to gotoAndStop() every other enterFrame event the MovieClip will run 2 x slower than the stage frameRate.