Timer

Timers, while not widgets strictly speaking, are defined in the same way as widgets. They allow you to define a recurring timed event. Timers may be associated with pages or the system object - the difference being that timers associated with pages are only able to be running when that page is visible.

Properties

Timers have the following attributes/properties:

PropertyDescriptionRequiredIn templateScript
nameThe name of the timerNo_timernnRead-only
intervalNumber of milliseconds between each OnTimer eventYesN/AYes
enabledWhether the timer is running or notNofalseYes

Methods

The following methods are supported by timers:

MethodDescription
start()Start the timer. Equivalent to setting the enabled property to true.
stop()Stop the timer. Equivalent to setting the enabled property to false.

Events

The following events are triggered by timers:

EventDescription
OnTimerOccurs each time the specified interval has elapsed (when the timer is enabled/started). You can make it a one-shot timer by just stopping the timer within this event.