2 Replies Latest reply on Jun 25, 2006 11:12 AM by Newsgroup_User

    Control with lingo a film loop

    Level 7
      Dear all:

      Do you know how to control a film loop. Stop, pause, rewind and play?

      many thanks


        • 1. Re: Control with lingo a film loop
          James Newton, ACP Level 3
          A filmLoop will play through to the end. I do not know of a way to stop or pause it. You can rewind and replay a filmloop:

            tell sprite("filmLoop") to set the frame = 1

          OR

            member("filmLoop").loop = FALSE -- rewinds the filmLoop as a side-effect
          • 2. Re: Control with lingo a film loop
            Level 7
            This behavior, dropped onto a filmloop sprite, should do it for you:


            --dave@blurredistinction.com
            -- http://www.blurredistinction.com/director

            property isPlaying, strtFrame, curFrame, backwards
            property isLooping, loopTot, curLoop

            on getPropertyDescriptionList
            pList = [:]
            pList.addProp(#isPlaying, [#comment:"Begin play at start:",
            #format:#boolean, #default:true])
            pList.addProp(#backwards, [#comment:"Play backwards:", #format:#boolean,
            #default:false])
            pList.addProp(#isLooping, [#comment:"Loop play:", #format:#boolean,
            #default:true])
            pList.addProp(#loopTot, [#comment:"Loop x times (0 for forever):",
            #format:#integer, #default:0])
            return pList
            end

            on beginSprite me
            tell sprite(me.spriteNum)
            curFrame = the frame
            strtFrame = curFrame
            end tell
            curLoop = 0
            end

            on exitFrame me
            if not isPlaying then
            tell sprite(me.spriteNum) to go curFrame
            else
            if backwards then
            prevFrame(me)
            else
            nextFrame(me)
            end if
            end if
            end

            on nextFrame me
            tell sprite(me.spriteNum)
            curFrame = curFrame + 1
            if curFrame > the lastFrame then
            curFrame = strtFrame
            curLoop = curLoop + 1
            if isLooping then
            if curLoop = loopTot then
            isPlaying = 0
            end if
            else
            isPlaying = 0
            end if
            end if
            go curFrame
            end tell
            end

            on prevFrame me
            tell sprite(me.spriteNum)
            curFrame = curFrame - 1
            if curFrame < strtFrame then
            curFrame = the lastFrame
            curLoop = curLoop + 1
            if isLooping then
            if curLoop = loopTot + 1 then
            isPlaying = 0
            end if
            else
            isPlaying = 0
            end if
            end if
            go curFrame
            end tell
            end

            on pausePlay me
            ispLaying = 0
            end

            on playNormal me
            isPlaying = 1
            backwards = 0
            end

            on playBackwards me
            isPlaying = 1
            backwards = 1
            end


            Then you can do:
            sprite(x).playBackwards()
            sprite(x).playNormal()
            sprite(x).pausePlay()


            HTH


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