This content has been marked as final. Show 5 replies
_systerm.time() returns a string, not a numeric value … so when you test _system.time() > myTime all you’re getting is the comparison of two strings. To compare time you need either numeric values or a date object. You could parse the string to get a numeric value but Buddy API makes it easier. With Buddy API you could do something like this:
currentTime = value(baSystemTime(%0H%0M%0S))
myTime = 120000
if currentTime > myTime then…
If you choose to use a date object be aware that only the Java Script syntax supports time, the lingo version is for dates only.
Try something like this:
gTime = the systemDate
gTime.seconds = gTime.seconds + 60 -- 60 seconds from now
vPeriod = 10 * 1000 -- check every 10 seconds
vTimeOut = timeOut().new("TimePassing", vPeriod, #timesUp)
on timesUp(dummy, aTimeOut)
vTimeNow = the systemDate
if vTimeNow >= gTime then
if vTimeNow.seconds > gTime.seconds then
alert "It is time..."
Applied CD wrote:
> _systerm.time() returns a string, not a numeric value ? ...
> ..... You could parse
> the string to get a numeric value but Buddy API makes it easier.
Thanks for that. But, need to have this happen in Shockwave. I didn't follow what
you meant in the for Java Script syntax.
I actually need to do something relatively simple. Right at the start of
the movie, need to check the time and then show something on screen
based on that time. I have morning information and afternoon information
tthat will show in my DCR. But, I want to define the tme when afternoon
information starts. Sometimes it may be 12pm, other times 1pm. So, want
to check the current time against my variable time and then load teh
right info at eh start.
Thanks both for your help.
I think I'll do it in the following way:
* check current time in seconds using: (the systemDate).seconds
* convert defined time like '12:00pm' to seconds by just separating the
hours and minutes and then having a mathematical equasion to convert it to
Both the above replies have been helpful in getting me to a solution.