5 Replies Latest reply on May 17, 2006 12:21 PM by Newsgroup_User

    auto advance wmv file

    earthmuse95
      hi - i'm trying to find some code to auto-advance a wmv file in director. you guys have been great in the past in helping me on a variety of ignorant questions, mostly around these kinds of scripting issues - including auto advance of flash, and mov files.

      does anyone have a script for this?

      thanks a bunch!
        • 1. Re: auto advance wmv file
          Level 7
          What do you mean by "auto-advance"? Do you mean "send the playback head
          to the next frame/another marker once the file has finished playing", or
          something different?
          • 2. Re: auto advance wmv file
            earthmuse95 Level 1
            yes - just send the playback head to the designated marker after playback is done. exactly!
            • 3. Re: auto advance wmv file
              Level 7
              You could try something like:
              --
              property spriteNum
              property my
              property myMember
              property myDuration
              property myTargetMarker

              on beginSprite me
              my = sprite(spriteNum)
              myMember = my.member
              myDuration = myMember.duration
              myMember.loop = 0
              if myMember.pausedAtStart then
              myMember.pausedAtStart = 0
              myMember.play()
              my.play()
              end if
              end

              on exitFrame me
              if my.currentTime >= myDuration then
              -- put "finished"
              _movie.goNext()
              end if
              end

              on getPropertyDescriptionList
              pdl = [:]

              lItem = [:]
              lItem[#comment] = "Marker to navigate to when finished:"
              lItem[#format] = #marker
              lItem[#default] = EMPTY

              pdl[#myTargetMarker] = lItem

              return pdl
              end
              • 4. Re: auto advance wmv file
                earthmuse95 Level 1
                wow - it just worked

                i copied it in, and it just worked

                you are awesome man!

                thank you so much!
                • 5. Re: auto advance wmv file
                  Level 7
                  > i copied it in, and it just worked

                  It shouldn't have been that simple, but I guess you were happy with
                  going to the next marker. The getPropertyDescriptionList-defined
                  property wasn't being used. Here's an amendment:
                  --
                  property spriteNum
                  property my
                  property myMember
                  property myDuration
                  property myTargetMarker

                  on beginSprite me
                  my = sprite(spriteNum)
                  myMember = my.member
                  myDuration = myMember.duration
                  myMember.loop = 0
                  if myMember.pausedAtStart then
                  myMember.pausedAtStart = 0
                  myMember.play()
                  my.play()
                  end if
                  end

                  on exitFrame me
                  if my.currentTime >= myDuration then
                  _movie.go(myTargetMarker)
                  end if
                  end

                  on getPropertyDescriptionList
                  pdl = [:]

                  lItem = [:]
                  lItem[#comment] = "Marker to navigate to when finished:"
                  lItem[#format] = #marker
                  lItem[#default] = EMPTY

                  pdl[#myTargetMarker] = lItem

                  return pdl
                  end