Index...
Centrallix Documentation
|
widget/timer
timer :: A nonvisual widget which is used to fire an event when a period of time has elapsed.
Metadata:
type: | widget/timer |
visual: | no |
container: | no |
form element: | no |
Overview:
A timer widget is used to schedule an Event to occur after a specified amount of time. Timers can be set to expire a set amount of time after the page is loaded, or they can be triggered into counting down via activating an Action on the timer. Timers can be used to create animations, delayed effects, and more.
Usage:
Timers are nonvisual widgets which can be placed almost anywhere in an application. They are most commonly found at the top-level of the application, however. Timers have no direct effects on the object in which they are placed. Timers can only contain Connector widgets.
Properties:
Property | Type | Description |
auto_reset |
boolean |
the timer starts counting down again immediately after it expires. |
auto_start |
boolean |
the timer starts counting down immediately after the page loads. |
msec |
integer |
of milliseconds (1/1000th of a second) before the timer expires. |
Actions:
Action | Description |
SetTimer |
action takes two parameters: "Time" (integer in milliseconds) and "AutoReset" (integer 0 or 1). It causes a timer to begin counting down towards an Expire event. |
CancelTimer |
actions causes a timer to stop counting down, and thus no Expire event will occur until another countdown sequence is initiated by a SetTimer action. |
Sample Code:
$Version=2$
// These timers trigger each other! You can make this app do something
// more interesting by putting other connectors on the Expire events of
// the timers as well :)
//
mytimerOne "widget/timer"
{
msec = 500; // half a second
auto_start = 1;
auto_reset = 0;
cnOne "widget/connector"
{
event="Expire"; target="mytimerTwo";action="SetTimer";
Time="500"; AutoReset="0";
}
}
mytimerTwo "widget/timer"
{
msec = 500;
auto_start = 0;
auto_reset = 0;
cnTwo "widget/connector"
{
event="Expire"; target="mytimerOne";action="SetTimer";
Time="500"; AutoReset="0";
}
}
Comments...
(none yet)
Add a Comment...
|