4 Replies Latest reply on Sep 20, 2016 11:23 AM by David Moyer

    Count down clock

    woo

      Hi,

      I need help on building a score board that has multiple count down clock that goes to 0 similar to hockey penalty clock.

      I did came up with two sample count down clock but can’t get to run at same time. When second clock is starts the first clock stops.

      Any idea how I can do this?

       

      Thank you

      Woo

        • 1. Re: Count down clock
          philmodjunk

          Would it work to put each "clock" in it's own floating document window? (Windows of this type are not modal so you can continue to edit data in another window, but do "float" in front of other windows and thus won't disappear behind behind other windows.)

           

          With a window for each, you could use InstallOnTimerScript on both windows to set up a separate timer on each. Getting smooth updates in all windows may not be practical, however. You'd need to test it and see.

          • 2. Re: Count down clock
            woo

            I am not sure about the Install OnTimerSchript, never used this script, is there sample somewhere?

            • 3. Re: Count down clock
              philmodjunk

              You can look it up in help.

               

              This step selects a script to be performed every x seconds. The seconds are specified in the parameter so you select a script and specify the interval in seconds. You can do this once to set up a timer from the context of any one window--hence my suggestion for two windows. The script you select would add 1 to a field or variable displayed in that window and you'll probably need to refresh the object after each update. (give the field or merge variable an object name and use refresh object to update its display after each time the value is changed).

               

              The specified script will continue to be performed at intervals until you either close its window or you "cancel" the timer. To cancel the timer, use install OnTimeScript again but with no parameters specified.

              • 4. Re: Count down clock
                David Moyer

                Hi,

                when you read up on InstallOnTimerScript, pay special attention to how they act in multiple windows.

                Also, if your timers need to be time-accurate, then you should probably use the timed script to update your display fields using a calculation based on GetAsNumber(Get(CurrentTime) - $startTime)