9 Replies Latest reply on Sep 15, 2007 8:59 AM by SAYEG

    Play Till ?

    Anton555
      I have a director movie that is paused on frame 1. I have 3 buttons (blue, green and black) all sitting on frame 1. I want to be able to tell director that if I press the blue button the movie will play until it reaches frame 25 and then stop. But if I press the green button I want the movie to play until it reaches frame 35 and then stop. The black button will be the same but it stops on frame 45. Can this be done??

      I presume that all the buttons will have a simple PLAY behaviour. Then frame 25, 35 and 45 will have lingo that says something like: If the BLUE button was clicked STOP, ELSE continue.

      Thanks
        • 1. Re: Play Till ?
          Level 7
          Try something like the following attached to each of the buttons (copy
          and paste into a behavior (#score) script and then drag onto your
          buttons, set the stop frame and test it - watch for unintentional line
          breaks, esp. in the GPDL handler):
          --
          property myEndFrame
          property _clicked

          on getPropertyDescriptionList
          return [#myEndFrame: [#comment: "Frame to stop on:", #format:
          #integer, #default: _movie.frame]]
          end

          on beginSprite me
          _clicked = 0
          end

          on mouseUp me
          _clicked = 1
          end

          on exitFrame me
          if _clicked then
          tFrame = _movie.frame
          if ( tFrame = myEndFrame ) then _movie.go(tFrame)
          end if
          end
          • 2. Re: Play Till ?
            Anton555 Level 1
            Thanks Sean...I tried it but it came back with this error:

            Script error: Operand expected

            return [#myEndFrame: [#comment: "35:", #format: ?
            • 3. Re: Play Till ?
              Level 7
              Where did the "35:" come from? That wasn't in my first post. If you
              followed my instructions, you don't need to modify the script at all.
              When you drop it on a sprite you'll be prompted for a frame number, at
              which point you should enter the relevant number for whichever sprite
              you're attaching the behavior to.
              Also, like I said, be careful of line breaks. I have no idea what the
              web forum will do to my post as I use Thunderbird to access the forum
              over nntp. There should be only one line of code in the GPDL handler so
              you may have to remove intoduced breaks.
              • 4. Re: Play Till ?
                James Newton, ACP Level 3
                Sean wrote: "watch for unintentional line
                breaks, esp. in the GPDL handler)"

                Your error is due to there being an invisible carriage return character after "format:". Delete all characters between "#integer" and "format:" (be sure to preserve the semi-colon), then try again.
                • 5. Re: Play Till ?
                  Anton555 Level 1
                  Thanks...I actually entered 35 into the script...and there was an invisible carrigae return.

                  Ok..so the script works, but when the movie has stopped on the BLUE frame and I click the BLACK button, nothing works.

                  Also, when I put a script on frame 1 (go to the frame) the script (yours) doesn't work.

                  What I am trying to replicate is something similar to this: http://www.interviewmagazine.com/

                  Thanks for all your help
                  • 6. Re: Play Till ?
                    Level 7
                    Try modifying the mouseUp handler like so:
                    --
                    on mouseUp me
                    _clicked = 1
                    _movie.go(_movie.frame + 1)
                    end
                    • 7. Re: Play Till ?
                      Anton555 Level 1
                      Ok...now when I press the buttons, the movie just moves 1 frame at a time and then stops
                      • 8. Re: Play Till ?
                        Level 7
                        Do you have a frameScript on *every* frame telling the playhead to "go
                        to the frame"?
                        Can you post a cut-down _small_ file somewhere?
                        • 9. Re: Play Till ?
                          SAYEG Level 1
                          Hi Anton, the video of the link you put is a flash video, so i think you are trying to do the same thing with a flash video.

                          Demo link http://www.tallerdg.com/mvid/mvid.htm

                          Files link http://www.tallerdg.com/mvid.rar

                          Hope this help.

                          SAYEG5