Wireless Markup Language (WML) Tutorial

The Timer Element

The ontimer attribute of the card element may be used with the timer element to automatically move to a new card after a predefined time. The ontimer attribute is assigned the name of the card to go to when the timer expires.

The timer element has a value attribute that determines how long to wait before the timer expires. The time is specified in 1/10ths of a second, therefore a value of ten will be approximately 1 second. Each card may only have a single timer element.

The following example has three cards. The first card has an ontimer event, set to expire after 3 seconds where it automatically moves to the next card. The next card also has an ontimer event that expires after 3 seconds to move automatically to the final card.


<?xml version="1.0" encoding="iso-8859-1" ?>
<card id="start" title="1" ontimer="#intro">
<timer value="30"/>
<p align="center">
    You're Always<br/>
<card id="intro" title="2" ontimer="#index">
<timer value="30"/>
<p align="center">
    Juicy Studio<br/>
    [email protected]
<card id="index" title="Juicy Studio">
<p align="center">
    The answer's @ Juicy Studio<br/>
    [email protected]

Output From Program

The following shows the cards in the order they appear at 3 second intervals.

The image shows the screen of a mobile phone with the output from the program, with three cards appearing in sequence controlled by the Timer

You might also like...


About the author

Gez Lemon United Kingdom

I'm available for contract work. Please visit Juicify for details.

Interested in writing for us? Find out more.


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Walking on water and developing software from a specification are easy if both are frozen.” - Edward V Berard