3 Replies Latest reply on Mar 27, 2012 5:38 AM by Ned Murphy

    Finding the Movie Framerate with Code

    Kwangle Level 1

      I can find the stage size of a movie thusly:

       

      myStageWidth = Stage.width;

       

      is there a way to do this to find the framerate of the movie the code resides in, or a loaded movie? eg (in pseudo code)

       

      myframeRate = myMovie.frameRate;

       

      Any help with this would be appreciated!

       

      Thanks,

      K

        • 1. Re: Finding the Movie Framerate with Code
          Ned Murphy Adobe Community Professional & MVP

          Unlike AS3, which has a frameRate property that you can read ad set using ciode, AS2 does not have such a property.  YOu can try to determine it indirectly, though it might not agree with the actual set value.  Here's a link to a discussion about that...

           

          http://forums.adobe.com/thread/918024

          • 2. Re: Finding the Movie Framerate with Code
            Kwangle Level 1

            Thanks for your help.

             

            I saw another thread that had an AS3 solution to this problem, but I guess I can work round this in AS2 by setting a variable that records the framerate - obviously this won't work if I want to import .swfs with unknown properties.

             

            The solution for measuring the length of a single frame is cunning and interesting approach, though I'm sure it is far from accurate! Counting a number of frames over a longer period might be a little better, but I'll bet you never get predictable results!

             

            Thanks again.

            K

            • 3. Re: Finding the Movie Framerate with Code
              Ned Murphy Adobe Community Professional & MVP

              You're welcome.  The trouble with asking a file what its frame rate is (using the frameRate property in AS3) is that it will report the value that is assigned in the document, not the actual frame rate that plays out.  Using a calculated approach is the only way to come close to getting the true rate.

               

              Just so it's clear though, a flash file can only have one frame rate at a time.  Movieclips within a Flash file and swf's imported dynamically will play at the frame rate of the main file.

              1 person found this helpful