3 Replies Latest reply on Jun 5, 2007 10:08 AM by gallion311

    Pausing a Windows Media Video at the end

    gallion311
      What up guys trying to figure out how to pause my Windows Media Video on the last frame once it has played through.

      I tried to just uncheck the Loop checkbox, but when it gets to the end it just goes back to the first frame and stops. There'sa a fair amount of text in mu video and I need it to stop on the last frame so the audience can continue once they've finsihed reading...

      Any way to do this by detecting the duration or movieTime and then setting the movieRate to 0?

      Or any other way?

      Thanks,
      rg

        • 1. Re: Pausing a Windows Media Video at the end
          gallion311 Level 1
          Alright I figured this one out by myself; figured I'd throw the answer out there incase someone else needs this functionality.

          So in my Director movie the movie timeline stops on the Windows Media Cast Member. I have my Windows Media video displayed as only 2 frames, so the Main director timeline stops, but the Window Media Video keeps playing. (Thats why I couldn't just set a "go to the frame" action becuase my movie would have about 10,000 frames.

          So anyway I put my Windows Media video on frame 9 and 10. On frame 10, I place some code to stop the director movie. Then I added this:

          on exitFrame

          if sprite("YourSpriteName").currentTime > 40000 then
          sprite("YourSpriteName").pause()
          end if

          go to the frame
          end


          So it checks the currentTime property; once it gets to 40,000 milliseconds (40 seconds) it pauses the movie.

          Done.
          • 2. Re: Pausing a Windows Media Video at the end
            imcgi04
            Hi there ,

            Is there any way of adapting this code so that it is applicable to swf files, or a piece of lingo that would have the same effect on an swf file?
            • 3. Re: Pausing a Windows Media Video at the end
              gallion311 Level 1
              Yeah I know there's a similar method that would work with SWF's.

              I believe its the exact same method, just different functions.

              Instead of the currentTime function; use movieTime.

              And instead of sprite("yourSpriteName").pause()

              use movieRate = 0, which is how you pause QT and Flash.

              So alltogether:

              if sprite("YourFlashSprite").movieTime > 1800 then
              sprite("YourFlashSprite").movieRate = 0
              end if

              The big difference is that currentTime is measured in milliseconds and movieTime is measured in ticks.

              So 1 second =
              60 ticks
              1000 milliseconds.

              So if you had a 30 seconds flash movie it would be 1800 ticks.

              rg