Reproduced with permission from Penworks Lingo User"s Journal
-- Source Code from the Lingo User"s Journal
-- Copyright (c) 1995 by Penworks Corporation
on startMovie
initTimer
setTimer(#MusicTimer, seconds(15))
SetTimer(#SoundTimer, seconds(30))
end startMovie
on stopMovie
put "(stopped)"
shutDownTimer
end stopMovie
on exitFrame
if timerExpired(#MusicTimer) then
put "Music timer expired"
setTimer(#MusicTimer,seconds(20))
end if
if timerExpired(#SoundTimer) then
put "Sound timer expired."
killTimer(#SoundTimer)
end if
go to the frame
end exitFrame
-- Timer Services
global timerList
on seconds numSeconds
-- Converts seconds to ticks, so you can refer to seconds(4) instead of 240 (4 * 60)
return(numSeconds * 60)
end seconds
on timerExpired whichTimer
-- Check to see if a given timer expired
set expirationTime =getAProp(timerList, whichTimer)
set expired =expirationTime and (getTimeCount() >= expirationTime)
return(expired)
end timerExpired
on setTimer whichTimer, numTicks
-- Set the expiration time of a timer
set expirationTime =getTimeCount() + numTicks
setAProp( timerList, whichTimer, expirationTime)
end setTimer
on killTimer whichTimer
-- Force a timer to expire
setAProp(timerList, whichTimer, 0)
end killTimer
on initTimer
set timerList=[:]
end initTimer
on shutDownTimer
end shutDownTimer
on getTimeCount
return the ticks
end getTimeCount
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA