2 Replies Latest reply on Feb 15, 2008 5:20 AM by andyulrika_is_back

    Playing Quicktime with Multiple Start End Points

    andyulrika_is_back Level 1
      Hello

      I posted a message a few days which I received help on regarding starting and ending a Quicktime movie from various points in the movie. Now I have a new problem which I cannot fix at all..

      Here is the problem:

      I have a Quicktime movie on stage and 10 various buttons that contain a generic script which allows input of start and end points for each button to trigger the movie. Initially just doing this with one button is successful.

      However, multiple buttons all with the same generic code make the movie freeze up completely. My guess is that they are all fighting each other for control. Maybe I need something in the code which allows the button that is being used to play the movie to keep control.

      Here is the code I use for each button, the movie is on frame 15.

      property pQT,pStart,pEnd,pFrame, pVolume

      on beginSprite me
      sprite(me.spriteNum).color=rgb (255,255,255)
      cursor 0
      if integer(pQT).ilk=#integer then pQT=integer(pQT)
      end

      on mouseUp me
      sound(3).volume=sprite(15).volume
      sprite(15).volume=pVolume
      sprite(pQT).movieTime=pStart
      sprite(pQT).movieRate=1
      cursor 0

      end

      on mouseEnter me
      sprite(me.spriteNum).color=rgb (173,24,41)
      sprite(me.spriteNum).cursor=280
      end

      on mouseLeave me
      sprite(me.spriteNum).color=rgb(255,255,255)
      sprite(me.spriteNum).cursor=0
      end

      on mouseDown me
      sprite(me.spriteNum).cursor=290
      end

      on enterFrame me
      if sprite(pQT).movieTime>=pEnd then
      sprite(pQT).movieRate=0




      end if
      end

      on getPropertyDescriptionList me
      if not the currentSpriteNum then exit

      vPDList=[:]
      setaProp vPDList, #pQT, [#comment: "Which QT sprite", #format: #integer, #default: 0]
      setaProp vPDList, #pStart, [#comment: "Range start", #format: #integer, #default: 0]
      setaProp vPDList, #pEnd, [#comment: "Range end", #format: #integer, #default: 0]
      setaProp vPDList, #pVolume, [#comment: "Volume", #format: #integer, #default: 0]

      return vPDList
      end getPropertyDescriptionList

      Any help is much appreciated. (not a lingo expert)

      Andy























        • 1. Re: Playing Quicktime with Multiple Start End Points
          Level 7
          You need for each button to know if it was pushed or not. And only
          monitor the current time of the QT movie if it was the button pushed...
          like this (once again, look out for inadvertent line breaks... there
          should be exactly 66 lines of code here):

          property pQT,pStart,pEnd,pFrame, pVolume,pMyControl

          on beginSprite me

          sprite(me.spriteNum).color=rgb (255,255,255)
          cursor 0
          if integer(pQT).ilk=#integer then pQT=integer(pQT)
          pMyControl=0
          end

          on mouseUp me

          sound(3).volume=sprite(pQT).volume
          sprite(pQT).volume=pVolume
          sprite(pQT).movieTime=pStart
          sprite(pQT).movieRate=1
          pMyControl=1
          cursor 0

          end

          on mouseEnter me

          sprite(me.spriteNum).color=rgb (173,24,41)
          sprite(me.spriteNum).cursor=280

          end

          on mouseLeave me

          sprite(me.spriteNum).color=rgb(255,255,255)
          sprite(me.spriteNum).cursor=0

          end

          on mouseDown me

          sprite(me.spriteNum).cursor=290

          end

          on enterFrame me
          if pMyControl then
          if sprite(pQT).movieTime>=pEnd then
          sprite(pQT).movieRate=0
          pMyControl=0
          go 1
          end if
          end if

          end

          on getPropertyDescriptionList me

          if not the currentSpriteNum then exit

          vPDList=[:]

          setaProp vPDList, #pQT, [#comment:"Which QT sprite", #format:#string,
          #default:0]
          setaProp vPDList, #pStart, [#comment:"Range start", #format:#integer,
          #default:0]
          setaProp vPDList, #pEnd, [#comment:"Range end", #format:#integer,
          #default:0]
          setaProp vPDList, #pVolume, [#comment:"Volume", #format:#integer,
          #default:0]

          return vPDList

          end getPropertyDescriptionList
          • 2. Re: Playing Quicktime with Multiple Start End Points
            andyulrika_is_back Level 1
            Many thanks Mike

            Works fantastically.

            I just thought I would post the finished code - well, tweaked ever so slightly from Mike's orginal for anybody wanting a nice little behaviour for controlling a Quicktime movie.

            (watch out for page breaks etc - should be 68 lines)



            property pQT,pStart,pEnd,pFrame, pVolume,pMyControl,pReturnMarker

            on beginSprite me

            sprite(me.spriteNum).color=rgb (255,255,255)
            cursor 0
            if integer(pQT).ilk=#integer then pQT=integer(pQT)
            pMyControl=0
            end

            on mouseUp me

            sound(3).volume=sprite(pQT).volume
            sprite(pQT).volume=pVolume
            sprite(pQT).movieTime=pStart
            sprite(pQT).movieRate=1
            pMyControl=1
            cursor 0

            end

            on mouseEnter me

            sprite(me.spriteNum).color=rgb (173,24,41)
            sprite(me.spriteNum).cursor=280

            end

            on mouseLeave me

            sprite(me.spriteNum).color=rgb(255,255,255)
            sprite(me.spriteNum).cursor=0

            end

            on mouseDown me

            sprite(me.spriteNum).cursor=290

            end

            on enterFrame me
            if pMyControl then
            if sprite(pQT).movieTime>=pEnd then
            sprite(pQT).movieRate=0
            pMyControl=0
            go pReturnMarker
            end if
            end if

            end

            on getPropertyDescriptionList me

            if not the currentSpriteNum then exit

            vPDList=[:]

            setaProp vPDList, #pQT, [#comment:"Which QT sprite", #format:#string, #default:0]
            setaProp vPDList, #pStart, [#comment:"Range start", #format:#integer, #default:0]
            setaProp vPDList, #pEnd, [#comment:"Range end", #format:#integer, #default:0]
            setaProp vPDList, #pVolume, [#comment:"Volume", #format:#volume, #default:0]
            setaProp vPDList, #pReturnMarker, [#comment:"Return to Marker", #format:#marker, #default:0]


            return vPDList

            end getPropertyDescriptionList