1 Reply Latest reply on Feb 17, 2009 12:00 PM by CravedGames.com

    Different/Seprate Frame Rate(FPS)

    CravedGames.com Level 1
      Im making a flash intro for my games and i found this code online that used to work but messes up for this intro i made for some reason. Does anyone have another code to put two different frame rates in one flash movie?

      MovieClip.prototype.tuneUp = function(fps, inherit, dir, endF) {
      var intv, mc, d, end;
      intv = 1000/fps;
      d = (dir == "down") ? -1 : 1;
      if (!endF) end = (dir == "down") ? 1 : this._totalframes;
      clearInterval(this.tuneUpID);
      this.tuneUpID = setInterval(fineTune, intv, this, d, this._currentframe, end);
      if (inherit) {
      for (var i in this) {
      if (typeof (this ) == "movieclip") {
      clearInterval(this
      .tuneUpID);
      this .tuneUpID = setInterval(fineTune, intv, this, d, this ._currentframe, end);
      }
      }
      }
      function fineTune(mc, d, sf, end) {
      _if = (sf<end) ? mc._currentframe < end : mc._currentframe > end
      if (_if) {
      mc.gotoAndStop(mc._currentframe+d);
      } else {
      clearInterval(mc.tuneUpID);
      }
      }
      };
      tuneUp(20, true);
        • 1. Re: Different/Seprate Frame Rate(FPS)
          CravedGames.com Level 1
          NVM i think this one works good:

          kirupaSound = new Sound(this);
          kirupaSound.attachSound("sound");
          kirupaSound.start(0, 1);


          MovieClip.prototype.setFrameRate = function(fps) {
          this.stop();
          if (this.__fpsInt__ != undefined) {
          clearInterval(this.__fpsInt__);
          delete this.__fpsInt__;
          }
          this.__nextFrame__ = function(ptr) {
          if (ptr._currentframe < ptr._totalframes) {
          ptr.nextFrame();
          } else {
          ptr.gotoAndStop(1);
          }
          updateAfterEvent();
          };
          this.__fpsInt__ = setInterval(this.__nextFrame__, Math.round(1000 / fps), this);
          };

          //_root.setFrameRate (50);
          this.setFrameRate(23);