card
onevent
template
WML TAG: timer
<timer value=... />
The
timer
tag serves as a timer clock for a card. The timer is started when the card is entered and stops when you exit the card. You can have only one
timer
element per card.
You can preset the timer to an amount of time in 1/10th second (decisecond) intervals (i.e., 10 deciseconds is 1 second). Once the timer has spent that amount of time in the card, you can specify an event to occur, such as going to a different card or deck. This permits you to handle inactivity or idle time on a site. (The timer counts down to zero starting from the specified time value.)
This tag may be used with the
card, onevent,
and
template
elements. Both the
card
and
template
tags have
ontimer
attributes. The
onevent
tag uses the
type
attribute set to
"ontimer"
.
Nested Tags:
None
Attributes
class
The optional
class
core attribute is used to assign one or more classes to the element. Multiple classes are separated by white space. The class name is case sensitive (i.e.,
Stocks
and
stocks
are not the same).
id
The optional
id
core attribute is used to assign an identifying name to a tag. The name must be unique to the entire deck and not just unique to a card. The first character of the name can be any letter or the underscore. The remaining characters can be any combination of letters, numbers, or underscores.
name
The optional
name
attribute provides the name of a variable that can have a value assigned to it or can assume the value specified by the
value
attribute.
value
The mandatory
value
attribute is an integer number used to set the amount of time in 1/10th second (decisecond) intervals for the timer (i.e., 10 deciseconds is 1 second). If a variable has been named in the
name
attribute, the number set by the
value
attribute becomes the default value for that variable. If the named variable already has a value assigned to it, then this attribute is ignored.
Code:
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.WAPforum.org/DTD/wml_1.1.xml">
<wml>
<card id="card1" ontimer="#card2">
<timer value="50" />
<p>
DevGuru
</p>
</card>
<card id="card2">
<onevent type="ontimer">
<prev />
</onevent>
<timer value="50" />
<p>
is great!
</p>
</card>
</wml>
This example assigns a time out value to the variable gobyebye:
Code:
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.WAPforum.org/DTD/wml_1.1.xml">
<wml>
<card id="card1" ontimer="exit.wml">
<timer name="gobyebye" value="50" />
<p>
This site self destructs in $gobyebye deciseconds!
</p>
</card>
</wml>
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information