Countdown Clock

T

Tom Rodeheaver

Does anyone know of a way to run an swf movie (a countdown clock) over a
number of slides being run on autopilot? I think I know what the answer is
but I'd love to hear if there are any solutions.
Thanks
 
P

Preschool Mike

Does it have to be a swf movie? If not I have a code I use for games that
some of the experts here helped me develop. Help yourself if you like.

'goes at top of module if you want a sound to play when time is up
Declare Function sndPlaySound32 Lib "winmm.dll" _
Alias "sndPlaySoundA" _
(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Public StopNow As Boolean 'if you want the time to stop

Sub Wait(waitTime As Long)
Dim start As Double
start = Timer
While Timer < start + waitTime

If StopNow Then
Exit Sub
Else
DoEvents
End If
Wend
End Sub

'You'll need to insert a shape on the master slide and give it a name
'like countdown clock .
Sub CountDown()
Dim dText As Date
Dim X As Long
StopNow = False
'make sure you remove the quotes
For X = "The amount of time for your clock in seconds (e.g., 120 = 2
minutes)" To 0 Step -1

If Not StopNow Then
dText = CDate(X \ 3600 & ":" & _
((X Mod 3600) \ 60) & ":" & (X Mod 60))
ActivePresentation.SlideMaster.Shapes("name of your shape") _
..TextFrame.TextRange.Text = Format(dText, "Nn:Ss")
Wait (1)
End If
Next
'If Not StopNow Then 'Quote out if you want the sound to play
'OutOfTimeSound
'End If

End Sub

'sound needs to be on c: drive
Sub OutOfTimeSound()
Call sndPlaySound32 _
("C:\"name of your sound", 0) 'remove the quote and insert sound name
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top