I am trying to complete a timer that counts down two minutes during a game after the
two minutes we have an "Intermission" come back and have another two minute period.
The Timer is shown on the screen the entire time it is running and we are going to
certain loops within the movie, based upon game interaction. The code I have is below
and is almost working... however there is a freezing of the timer as director pulls
questions from a pre-randomized list (this is done in the begging of the game before
we start the timer). It then jumps ahead to where the timer is supposed to be but
this is unacceptable. The timer needs to be the most critical function that director
performs.
Any thoughts or Ideas?
on startTheTimer
global gStartTime, gCurrentString, currTime
-- count down
gStartTime = the milliseconds + 120000
gCurrentString = ""
currTime = gStartTime - the milliseconds
if currTime < 0 then
currTime = 0
end if
showTime
end
on showTime -- I'm calling a showTime from each enterFrame
global millisec, minString, secString, milliString, currTime, gCurrentString,
gStartTime
-- calculate minutes, seconds and milliseconds
currTime = gStartTime - the milliseconds
sec = integer(currTime/1000)
minute = integer(sec/60)
sec = sec - minute*60
hour = integer(minute/60)
minute = minute - hour*60
millisec = millisec - sec*1000 - minute*60*1000 - hour*60*60*1000
minString = string(minute+100).char[2..3]&":"
secString = string(sec+100).char[2..3]
milliString = string(millisec+1000).char[2..4]
milliString = "."&milliString.char[1..2]
-- create time string
text = minString&secString -- &milliString
-- update text member only if needed
if text <> gCurrentString then
member(37).text = text
gCurrentString = text
end if
updateStage
end
Thanks guys,
Tony Eggleston
Imagine Media, Inc.
[EMAIL PROTECTED]
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]