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!
Thanks for the suggestion, unfortunately, I need to do this with code, because my animation does not continuously play, but is controlled by actions.
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/
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.
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.