6 Replies Latest reply on Mar 25, 2007 11:41 AM by millja

    Speed of movieclip

    millja
      I have a movieclip that needs to be played at different speeds: 2 seconds, 5 seconds and 8 seconds. They need to be played at "exactly" the same speed on different computers (it's ok with a few miliseconds difference, but at the moment the 8 second movie takes between 5-9 seconds :( )

      I've used setInterval to move to the next frame ever 75 milisecond... How can i make sure the movie is played at exactly 2, 5 or 8 seconds? Please help me...!
        • 1. Re: Speed of movieclip
          Level 7
          millja,

          > I have a movieclip that needs to be played at different speeds:
          > 2 seconds, 5 seconds and 8 seconds.

          > I've used setInterval to move to the next frame ever 75
          > milisecond... How can i make sure the movie is played at
          > exactly 2, 5 or 8 seconds? Please help me...!

          Milliseconds are 1,000ths of a second, so 2,000 milliseconds is 2
          seconds; 5,000 milliseconds is 5 seconds, and so on. Where are you getting
          stuck?


          David Stiller
          Adobe Community Expert
          Dev blog, http://www.quip.net/blog/
          "Luck is the residue of good design."


          • 2. Re: Speed of movieclip
            millja Level 1
            Well, i'm testing the movie at different computers and with different browsers. The movie that's supposed to last for 8 seconds lasts for 5-9 seconds, which is way to much variance to what i need. It's ok if it takes 7.5-8.5 seconds to play the 8-second moive though.

            (the setInterval with 75 milliseconds is used for the 8-second movie. It's a 40 frames movie, and when testing on my computer that was the best interval to get an 8 second movie. Turns out it didn't work on other computers :( ) Do you understand what i mean? It's a bit difficult to explain in english ;)
            • 3. Re: Speed of movieclip
              Level 7
              millja,

              > Well, i'm testing the movie at different computers and with
              > different browsers. The movie that's supposed to last for 8
              > seconds lasts for 5-9 seconds, which is way to much
              > variance to what i need. It's ok if it takes 7.5-8.5 seconds
              > to play the 8-second moive though.

              I'm curious what you're animating (if that's what you're doing) ... it's
              simply a fact of life that complex animations -- especially those with alpha
              transparency and the manipulation of significantly many anchor points --
              will vary from computer to computer, depending on CPU speed and other
              factors.

              > (the setInterval with 75 milliseconds is used for the 8-second
              > movie. It's a 40 frames movie

              What is it this setInterval() loop is doing, exactly?


              David Stiller
              Adobe Community Expert
              Dev blog, http://www.quip.net/blog/
              "Luck is the residue of good design."


              • 4. Re: Speed of movieclip
                millja Level 1
                I've got several screenshots of maps, and i'm using motion tween to create a zooming effect. These zooming maps are saved as swf-files and opened in the main movie. Then i use setInterval in the main movie to move forward in the zoom movies, one frame at a time. I used setInterval to be able to change the speed, but i'm considering to save 9 swfs instead (3 sets of zoom * 3 speeds), each with different fps. Then i'll use onEnterFrame to move forward. I'm not sure if it'll work though. I did a small test, and it seemed more stable when i did it like this.
                • 5. Re: Speed of movieclip
                  Level 7
                  millja,

                  > I've got several screenshots of maps, and i'm using motion
                  > tween to create a zooming effect. These zooming maps are
                  > saved as swf-files and opened in the main movie.

                  If those maps are especially complex, rapid zooming may indeed be
                  difficult for some computers, simply because of the calculations needed to
                  produce the visual change.

                  > Then i'll use onEnterFrame to move forward. I'm not sure if
                  > it'll work though. I did a small test, and it seemed more stable
                  > when i did it like this.

                  Frame loops and setInterval() are pretty much the two ways to accomplish
                  programmed animation. Either approach works; it's just that onEnterFrame is
                  based on the framerate of the movie itself, while setInterval() is based on
                  a clock. By all means, if onEnterFrame is giving you better results, use
                  that. :)


                  David Stiller
                  Adobe Community Expert
                  Dev blog, http://www.quip.net/blog/
                  "Luck is the residue of good design."


                  • 6. Re: Speed of movieclip
                    millja Level 1
                    Thank you so much for taking the time to answer me! I'll try it out and see if it works, if not, i might get back with some more questions ;)