4 Replies Latest reply on Jun 4, 2013 7:11 AM by ladal9

    Periodically update time display


      I need to periodically update my display with the current time.  I tried using setInterval, but I can only get the time to display once and not update.  Does anyone have any suggestions?

      Thank you.

        • 1. Re: Periodically update time display
          elainecc Adobe Employee

          Hi, ladal9-


          You can create a symbol that updates once every minute instead of using code.  Just switch your text field to a symbol, and at the 1 minute mark, create a trigger that updates your text field.  Hope that helps!



          • 2. Re: Periodically update time display
            ladal9 Level 1



            Thanks for the suggestion, unfortunately, I need to do this with code, because my animation does not continuously play, but is controlled by actions.

            • 3. Re: Periodically update time display
              heathrowe Most Valuable Participant

              I am not sure how you have your project set up, but one way is to use the Timeline event handler UPDATE. My example uses the one attached to the default timeline.


              See example : http://heathrowe.com/edge/timelineevents/

              Download:     http://heathrowe.com/edge/timelineevents/timelineevents.zip


              Click the green circle to play my stellar animation

              Timer element is updated with two variations of time

              First is the elapsed time from the moment of play (in milliseconds).

              The second is a custom date object (new Date()) that shows an updated clock from the moment the animation plays to end.




              • 4. Re: Periodically update time display
                ladal9 Level 1



                Thanks for the response.  It worked great, but I'm still having an issue.  I'm creating a trainer for a piece of hardware and one of the items displayed on the hardware is current time.  I've created several Triggers representing the different states/displays of the hardware, and for each Trigger I have different Actions representing key presses on the device. . 


                My problem is that when I change to a Trigger, the time on the page is displayed once, but I don't know how to have it continuously update (1/sec).   I tried using setInterval, thinking it would set up periodic processing, but that doesn't seem to be working.  I think I need to put this processing wherever the processing is that is waiting for an Action to occur, but I don't know how to do that in Edge.


                Any suggestions you have would be appreciated.