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
B1010 - How do I show a properly formatted real-time clock? by - Joseph Ganci Here's what you can
embed on the screen to do what you want. If you need a 24-hour clock, military
time:
{Test(Hour < 10 , "0"
, "")}{Hour}:{Test(Minute < 10 , "0" , "")}{Minute}
If you want a 12-hour
clock:
{Test(Hour > 9 & Hour
< 13 | Hour > 21 , "" , "0")}{Test(Hour < 13, Test(Hour > 0 , Hour, 12) ,
Hour - 12)}:{Test(Minute < 10 , "0" , "")}{Minute}
If you want an AM or
PM to appear after the 12-hour time, append to the script right above with:
{Test(Hour > 11 , "PM"
, "AM")}
Be sure to choose the
Icon Properties for the Display icon in which you're using the above script
and select the Update Displayed Variables option. Your time will show on the
screen beautifully. |