Date: Wed, 23 Aug 1995 17:57:59 +1000 From: Dorian DowseI recently was doing a presentation in Director with a long audio voiceover that required a series of events to occur cued to various parts of the speech.Subject: TIP - Timing animation to soundtracks
I so was pleased with the solution I came up with, that I thought I'd post it on the list.
This script is for getting Director to wait for audio cues. It comes in 2 parts.
on startMovie
global cueList
set cueList=[]
set the keyDownScript to "do startSound()"
pause
end
on startSound
startimer
sound playFile 1, "sound.aif"
set the keyDownScript to "do addCue()"
end
on addCue
global cueList
if soundBusy(1) then
add Cuelist, the timer
else
add Cuelist, the timer
set the keyDownScript to ""
put cueList
end if
end
When the sound has finished,
the cue list is put in the message window
select it and copy it to the clipboard.
on starMovie global cueList, cuePos set cueList = ["paste the cueList from the message window here"] set cuePos = 1 end on playSound starTimer sound playFile 1, "sound.aif" endPut the exitFrame handler in the frame script of each frame where you want a cued paused. This handler will loop until the cue is reached, then continue on to the next frame. it could also launch scripts, objects, etc.
on exitFrame
--waitForCue
global cueList, cuePos
if the timer > getAt(cueList,cuePos) then
set cuePos = cuePos + 1
else
go to the frame
end if
end