4 Replies Latest reply on May 3, 2006 11:29 AM by Newsgroup_User

    preserving framerate of an imported movieclip

    Level 7
      if I have an animation movieclip imported into another movieclip with a
      different framerate, how do I force the imported clip to play at its
      original framerate?


        • 1. Re: preserving framerate of an imported movieclip
          Peter Lorent Level 2
          >>an animation movieclip imported into another movieclip
          As in - a swf imported into another swf - or are you importing a movieclip from one project into another which is running at a different framerate?
          • 2. Re: preserving framerate of an imported movieclip
            Level 7
            for the moment I am importing a MC from one FLA to another
            But I am also intersted tolearn about the second case you mentioned -
            importing SWF into FLA

            "LuigiL" <webforumsuser@macromedia.com> wrote in message
            news:e3a4ft$9mm$1@forums.macromedia.com...
            > >>an animation movieclip imported into another movieclip
            > As in - a swf imported into another swf - or are you importing a
            movieclip
            > from one project into another which is running at a different framerate?
            >


            • 3. Re: preserving framerate of an imported movieclip
              Peter Lorent Level 2
              Come to think of it, is there any difference...
              The framerate you set for the 'motherfla' will be the framerate for all mc's, imported sfw's included. So, you must use a function to set the framerate for a particular mc. And kglad kindly posted the following code to achieve that.

              //to use, specify the movieclip, frame rate and frames to play - forward or backward, doesn't matter:

              yourMC.playF(1,yourMC._totalframe,33);
              //------------------------------------------------------------------
              MovieClip.prototype.playF = function(m, n, fps) {
              if (!var3141592) {
              var3141592 = 0;
              playA = new Array();
              }
              this.m = m;
              this.n = n;
              this.fps = fps;
              this.gotoAndStop(this.m);
              playA[var3141592] = setInterval(playF2, 1000/this.fps, this, var3141592);
              var3141592++;
              };
              function playF2(mc, ind) {
              if (mc.m<mc.n) {
              mc.nextFrame();
              } else {
              mc.prevFrame();
              }
              if (mc._currentFrame == mc.n) {
              clearInterval(playA[ind]);
              }
              updateAfterEvent();
              }

              • 4. Re: preserving framerate of an imported movieclip
                Level 7

                "LuigiL" <webforumsuser@macromedia.com> wrote in message news:e3af4v$n7m$1@forums.macromedia.com...
                > Come to think of it, is there any difference...
                > The framerate you set for the 'motherfla' will be the framerate for all mc's,
                > imported sfw's included. So, you must use a function to set the framerate for a
                > particular mc. And kglad kindly posted the following code to achieve that.

                Good code but it doesn't affect the frame rate, it just shows some frames at odd times using a timer and updateAfterEvent. The
                actual frame rate isn't changed.
                tralfaz