9 Replies Latest reply on Jun 15, 2006 11:32 AM by Fragboy

    Stoping the time line

    Fragboy
      I have looked throught this forum a i did not find what i needed, So here it is. i am using Director MX 2004

      I have a video say 2 mins long and it is on the score for 3600 frames (30 frames per second for 2mins = 3600 frames) at the end of the video it will jump to the main title page using markers Using this code in the score script

      on exitFrame me
      _movie.go("Start")
      end

      I have made buttons for play,pause and rewind, which work fine to control the WMV I made. The problem is that i need to stop the timeline or pause it when the pause button is clicked with the mouse and when i click play the time line starts back up. Right now when the pause button is click the video stops and the time line continues to the end were it jumps back to start.
      So far i tried using this code:

      on exitFrame me
      _movie.go(_movie.frame)
      end

      and it stoped the timeline but I could not find how to start the timeline. any help would be great.

      thanks :D
        • 1. Re: Stoping the time line
          Level 7
          You only need one frame to play your video. Just put this in the frame
          script:

          on exitFrame me
          if sprite(x).movieTime < sprite(x).member.duration then
          _movie.go(_movie.frame)
          end if
          end

          Then on your pause button:

          on mouseUp me
          sprite(x).pause()
          end

          Play button:

          on mouseUp me
          sprite(x).play()
          end


          HTH

          --
          Dave -
          Adobe Community Expert
          www.blurredistinction.com
          http://www.adobe.com/communities/experts/


          • 2. Stoping the time line
            Fragboy Level 1
            Sorry DMennenoh not what i am looking for. When i tryed it, it was the same as what i already had. I am not looking to control the Video file that works. I need some thing to control the timeline play and pause because i have the video stretch over the timeline and at the end I have it jumping back to the "start" marker. If you have any other thoughts or coding to look at to do this that would be great.

            thanks
            • 3. Re: Stoping the time line
              Level 7
              Actually there should be no connection/dependencies between the timeline in
              director and a sprite containing a video. Even if a video and a director
              movie is set to the same framerate it is not at all reliable to syncronize
              between them.

              Director is eventdriven, but will try to perform the framerate set in the
              control panel or by lingo, if it can - the bottomline is, it will depend to
              much on the power of the computer. Also imagine to deal with the timeline
              when having a video 2 hours long.....I know that you don't, but just imagine
              :)

              If having other media to present - images, animation, changing background
              and so on - depending on where you are in the video, then the most common
              way is using movieTime as Dave Mennenoh suggests. Many videoformats also
              supports cuepoints.
              Both ways you stay on the same frame until a certain time/point is passed -
              and when it is, call a script/go to the next frame or whatever.

              On the other hand, if you allready made this, and a lot of e.g
              scoreanimation, then use _movie.go(_movie.frame +1) or simply: go the frame
              +1.


              • 4. Re: Stoping the time line
                Fragboy Level 1
                I do understand that it all depends on the computer for sync. I was just trying to get a ballpark time. I would love to use a que point like with quick time file but i am using WMV and it does not have a que point. I am trying to have at the end of the video playing it will jump to "start" marker, no mater how long they pause the vidoe and then play it again.

                I will look at the movieTime and _movie.go(_movie.frame +1) and see what i find. also if you could a sample usage of movieTime comand based on what i have posted so far just in case i can not get the ling right.

                thanks a bunch :D
                • 5. Re: Stoping the time line
                  Level 7
                  Not to beat a dead horse, but Dave posted the exact code that you can
                  use to do what you are trying to do. You can have your quicktime sprite
                  take up as much room in your timeline as you want, though, as everyone
                  has already advised you, it is just as easy to put it into 1 frame. On
                  that 1 frame (or in your last frame if you want it to take up a lot of
                  space in your score), use this script:

                  on exitFrame me
                  if sprite(x).movieTime < sprite(x).member.duration then
                  _movie.go(_movie.frame)
                  end if
                  end

                  That will keep the playhead in the same place until the end of the
                  movie. Then it will advance to the next frame when the movie is done.
                  • 6. Re: Stoping the time line
                    Fragboy Level 1
                    When i used dave's code it did not work. At the end of my video it just sat there. I made the sprite(x) the sprite channel of the video currently is 2. Also you said a Quicktime sprite and I am using a Windows Media Video file, I do not know if that makes a difference.
                    I did not know the ling well so I am not sure how thay are used properly. i know enouf to get me in trouble :D

                    thanks for your help.
                    • 7. Re: Stoping the time line
                      Level 7
                      Sorry about that horse..., but I think that for wmv it's currentTime instead
                      of movieTime:

                      if sprite(x).currentTime < sprite(x).member.duration then



                      • 8. Re: Stoping the time line
                        Level 7
                        On Wed, 14 Jun 2006 21:13:56 GMT, Fragboy posted in
                        macromedia.director.lingo:

                        > Also you said a Quicktime sprite and I am using a
                        > Windows Media Video file, I do not know if that makes a difference.

                        Indeed it does. As Anders mentioned (in case you missed it), use currentTime
                        instead of movieTime.


                        --
                        Mark A. Boyd
                        Keep-On-Learnin' :)
                        • 9. Re: Stoping the time line
                          Fragboy Level 1
                          currentTime worked.

                          Thanks all :)