3 Replies Latest reply on May 5, 2006 10:30 PM by Newsgroup_User

    Multiple Timers or other solution

    mr_ben_2006
      Hi! Basically in my movie I want 2 timers, which require movie scripts. However they are overwriting each other. Is there anyway I can put a movie script on an individual frame? If this is not available is there anyway I can have a timer in a movie script to start when a certain frame opens?

      Cheers in advance

      Ben
        • 1. Re: Multiple Timers or other solution
          Level 7
          A timeout object that calls timerOneOut handler after 10 sec.:
          timeout().new("timerOne", (10*1000), #timerOneOut)

          Handler for a moviescript:
          on timerOneOut
          --do something
          end

          To erase the object:
          timeout("timerOne").forget()

          Notice that this is MX 04 syntax. Movie needs to be running. Make any amout
          of timers.



          • 2. Re: Multiple Timers or other solution
            mr_ben_2006 Level 1
            cheers for the reply

            is there anyway however i can do it on entering a frame rather than a set number of seconds
            • 3. Re: Multiple Timers or other solution
              Level 7
              If you want to start a timer when entering a frame, so the timer can execute
              something after a certain time, then put the following in a framescript:

              on beginSprite me
              timeout().new("timerOne", (1000), #timerOneOut)
              end

              and put the following timerOneOut handler in a movieScript:

              on timerOneOut
              beep --(or do something else)
              --to only run the timer once:
              timeout("timerOne").forget()
              end

              You can also count a number of frames when looping the playhead on a
              specific frame, but the time can vary depending on the machine it's running
              on and the framerate of the movie.
              Notice that a timer is a well described object in director - please explain
              why you need one.


              > cheers for the reply
              >
              > is there anyway however i can do it on entering a frame rather than a set
              > number of seconds