5 Replies Latest reply on Dec 21, 2006 3:07 PM by Newsgroup_User

    Is movieTime and duration not precise???

    SelLola
      Hi everybody,

      I want to compare the movieTime and duration of a quicktime video. When the movie is ended I want to go to a specific marker. In other words if the movieTime equals the duration I want to go the the marker otherwise it must go to the frame. The code below is not working because the movieTime is not checked every single tick! In the message window I can see it counts every two or three ticks. A simple sum will do "if movietimeOpbouw > (durationOpbouw - 5) then" but I want to do it precisely. Is that possible?
      Thanks in advance.

      on exitFrame me
      movietimeOpbouw = sprite(1).movieTime
      durationOpbouw = sprite(1).duration
      if movietimeOpbouw = durationOpbouw then
      go to marker("stap 2")
      else
      go to the frame
      end if
      end
        • 1. Re: Is movieTime and duration not precise???
          Level 7
          Hi SelLola,

          Typically, when a QT reaches the end, the movieRate goes to 0. So, you could have
          something like:
          on exitFrame
          if sprite(1).movierate =1 then
          go the frame
          else
          go to "stap 2"
          end if
          end

          As mentioned by me in a few posts up:
          It's best to test the duration of the video cast member rather than the sprite. You

          could use
          (sprite(1).member).duration
          and I tend to loop while the current time is less than the duration.

          So, you could have something like:
          on exitFrame
          if sprite(1).movieTime =1 (sprite(1).member).duration
          go the frame
          else
          go to "stap 2"
          end if
          end

          regards
          Dean

          Director Lecturer / Consultant
          http://www.fbe.unsw.edu.au/learning/director
          http://www.multimediacreative.com.au

          • 2. Re: Is movieTime and duration not precise???
            SelLola Level 1
            Hmm, I know what the problem is. It is because I read out the movieTime on exitframe. Is there the possibility to check the movietime my script on every tick? But it must not take to many processing time. It is most important that the quicktime video plays as it should!

            Any options?
            • 3. Re: Is movieTime and duration not precise???
              SelLola Level 1
              Thanks,

              that example with the movieRate is much easier than the way I did it.

              Allthough I believe to compare the movietime and duration must work as well! In your second example the movieTime still counts up with two or three ticks. My Duration of the video is 300 and when the movietime reaches 298 it goes to 0 so I can't compare them.

              Anyway thanks for the movieRate example, I will use that one.
              • 4. Re: Is movieTime and duration not precise???
                Level 7
                SelLola wrote:

                > Hmm, I know what the problem is. It is because I read out the movieTime on
                > exitframe. Is there the possibility to check the movietime my script on every
                > tick? But it must not take to many processing time. It is most important that
                > the quicktime video plays as it should!
                >
                > Any options?

                You could use 'idle' even handler. 'idle' is when no other event is happening.
                So, between 'exitFrame's
                You could attach this to the video sprite:


                on idle
                if sprite(1).movieTime =1 (sprite(1).member).duration
                go the frame
                else
                go to "stap 2"
                end if
                end


                You'd still need an
                on exitFrame
                go the frame
                end


                It's not good to use 'idle' too much as it can be processor intensive.

                regards
                Dean

                Director Lecturer / Consultant
                http://www.fbe.unsw.edu.au/learning/director
                http://www.multimediacreative.com.au


                • 5. Re: Is movieTime and duration not precise???
                  Level 7
                  instead of duration try stoptime

                  "SelLola" <webforumsuser@macromedia.com> wrote in message
                  news:embgva$qos$1@forums.macromedia.com...
                  > Hi everybody,
                  >
                  > I want to compare the movieTime and duration of a quicktime video. When
                  > the
                  > movie is ended I want to go to a specific marker. In other words if the
                  > movieTime equals the duration I want to go the the marker otherwise it
                  > must go
                  > to the frame. The code below is not working because the movieTime is not
                  > checked every single tick! In the message window I can see it counts every
                  > two
                  > or three ticks. A simple sum will do "if movietimeOpbouw >
                  > (durationOpbouw - 5)
                  > then" but I want to do it precisely. Is that possible?
                  > Thanks in advance.
                  >
                  > on exitFrame me
                  > movietimeOpbouw = sprite(1).movieTime
                  > durationOpbouw = sprite(1).duration
                  > if movietimeOpbouw = durationOpbouw then
                  > go to marker("stap 2")
                  > else
                  > go to the frame
                  > end if
                  > end
                  >