Think of something that you wish Authorware could do but it doesn't?  Let the our good friends at Macromedia know via the wishlist.

Please let us know if you find any of the materials on this site inappropriate or offensive. Please include the url and why the material should be reviewed.

Comments and questions about the site are also welcome. Please no Authorware questions, use the AWARE list.


B1004 - How can I show a running minutes:seconds digital clock?

by - Joseph Ganci

I was wondering if anyone has developed anything or knows of a way to show a digital clock running in the background of an AW piece, while the program continues executing other code on the flow line.  I have a section of a course that times the user and I want to be able to display minutes:seconds as they tick away.

At the beginning of your section, place a Calculation icon that contains the following expression:

    basetime := SystemSeconds
This will set the basetime to the number of seconds your system has been running since it was last turned on.

In your Display icon, place the following expression.  Be sure to type it exactly. 

    {INT((SystemSeconds-basetime)/60)}:{Test(INT(MOD(SystemSeconds-basetime,60)) <10,"0","")}{INT(MOD(SystemSeconds-basetime,60))}
Note that the above is written all one one line in the Display icon.  The curly brackets around the expression tell Authorware to evaluate the expression between them, then display the result.  The rest not only calculates the number of minutes and seconds since you started the section, but also pads the seconds with a 0 when there are fewer than 10.  For instance, you will see 1:04 instead of 1:4 using the expression above.  It's a little hairy, but it works!

One other important matter.  You must set the Display icon's Properties dialog box to Update Displayed Variables.  This will allow the expired minutes and seconds to continue to update on the screen. 

There are 0 reviews
Add your review