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.

Back

B1022 - How do I show a countdown timer?

by - Joseph Ganci


I need to show a countdown that starts from 2 minutes, to 0. How can I do it?

Assuming you're in an interaction when you want to show a countdown clock, attach a time limit response and set it to 120 seconds (you can have its branching set to Try Again if you wish for the time limit to be ignored after 2 minutes). In the Interaction icon, set the property Update Displayed Variables and put the following on the screen:

{INT((TimeRemaining) / 60)}:{Test(INT(TimeRemaining - INT((TimeRemaining) / 60)*60) < 10,"0", "")}{INT(TimeRemaining - INT((TimeRemaining) / 60)*60)}

That should do it. It will even put in a leading zero when the number of seconds fall below 10.

If you're not in an interaction, it's a little more difficult. I've taken a real fast crack at it, so I'm expecting those of you who may have a little more time to pare the following down.

Put a display icon on the flowline and call it "count down" (or something similar). Attach to it a Caculcation ornament containing the following:

start := SystemSeconds
timer := 120

(Note that you can set the timer above to however many seconds you wish).

In the display icon, set it to Update Displayed Variables and place the following:

{Test(INT((timer - (SystemSeconds - start)) / 60) > 0, INT((timer - (SystemSeconds - start)) / 60), "0")}:{Test(INT(timer - (SystemSeconds - start) - INT((timer - (SystemSeconds - start)) / 60)*60) < 10,"0", "")}{Test(INT(timer - (SystemSeconds - start) - INT((timer - (SystemSeconds - start)) / 60)*60) > 0, INT(timer - (SystemSeconds - start) - INT((timer - (SystemSeconds - start)) / 60)*60), "0")}

It's hairy, but it works!

There are 0 reviews
Add your review
Back