3 Replies Latest reply on Apr 17, 2007 6:09 AM by Newsgroup_User

    Projector Start Over

    medonald1
      Hello All,

      OK, this is what I have. I am trying to get a projector to start over after 15 minutes. Both of these work, but after the first time they work as soon as I click on a tab it jumps back right away.

      It's like the projector thinks after I've done this once. I'm just going to keep doing it right away instead of waiting. Am I missing something?

      I will try again, just in case I am not giving enough info. The first time I run the projector it will wait the correct time and jump back to the index or page one. Now every time after that if I go to the page that is supposed to wait the 15 minutes, it will not wait, it just jumps back.

      :(

      on exitFrame
      if the timer > (1000*4) then go to "1" (the 4 would be what ever 15min. would be, i think 900)
      else
      go to the frame
      end if
      end


      I also tried this.

      on exitFrame
      if the timer > (30*1800) then go to "index"
      else
      go to the frame
      end if
      end

      Thank you very much.
        • 1. Re: Projector Start Over
          Level 7
          If you are going to use 'the timer' like that, you will want to rest it
          using startTimer (perhaps in frame 1)

          However, there are easier ways to do this. One option might be the
          following (as your frameScript):
          --
          property myNavigateTime

          on beginSprite me
          myNavigateTime = (the milliseconds) + (15 * 60 * 1000)
          end

          on exitFrame me
          if (the milliseconds > myNavigateTime) then
          go to frame 1
          else
          go to the frame
          end if
          end

          Or this /might/ account for the clock rolling over at midnight:
          property myNavigateTime

          on beginSprite me
          myNavigateTime = (the systemDate).seconds + (15 * 60)
          end

          on exitFrame me
          if ((the systemDate).seconds > myNavigateTime) then
          go to frame 1
          else
          go to the frame
          end if
          end
          • 2. Re: Projector Start Over
            Chunick Level 3
            use a timeOut object.

            so, based on your example it might look like this:

            on exitFrame me
            if not objectP(timeOut("timerHandler")) then
            timeOut().new("timerHandler",90000, #timerHandler, me)
            end if
            go the frame
            end

            on timerHandler me
            go "index"
            timeOut("timerHandler").forget()
            end

            -- note that timeOut objects are measured in milliseconds so 1000 ms = 1 sec. Alos, you can change the name of the timeout object and the handler to whatever you like.

            if you wanted to place the timeout object in an on exitFrame handler, but call the timeout handler from a moviescript then it might look like this:


            so, based on your example it might look like this:

            -- in a frame/behaviour script
            on exitFrame me
            if not objectP(timeOut("timerHandler")) then
            timeOut().new("timerHandler",90000, #timerHandler)
            end if
            go the frame
            end

            -- in a movieScript
            on timerHandler
            go "index"
            timeOut("timerHandler").forget()
            end
            • 3. Re: Projector Start Over
              medonald1 Level 1
              WOW! Now I am lost.

              :(

              I am still kinda new to Lingo. That thing is amazing. I wish I knew what how it worked. I hope it does work.

              THANK YOU VERY MUCH.

              :)