Well, it's close! I added a console.log to your script as follows:
function runSlideTimer() { window.audioDuration = cp.movie.am.slideAudios[slideData.audioName].duration.toFixed(0); window.audioTime = cp.movie.am.slideAudios[slideData.audioName].nativeAudio.currentTime.toFixed(0); console.log(window.audioTime); console.log(window.audioDuration); } |
I am seeing the correct information in the console, but cannot seem to get it into the captions. I tried both of the following:
$$audioTime$$
$$audioDuration$$
$$window.audioTime$$
$$window.audioDuration$$
Thanks again for your help.
Did you create the variables in Captivate under Project/variables? You need to create them first and give them a value of 0.
In the caption use:
$$audioTime$$
$$audioDuration$$
Also you need to wrap some of the code in this if statememt to prevent an error if there isn't any audio:
function runSlideTimer()
{
if ( slideData.audioName != undefined )
{
window.audioDuration = cp.movie.am.slideAudios[slideData.audioName].duration.toFixed(0);
window.audioTime = cp.movie.am.slideAudios[slideData.audioName].nativeAudio.currentTime.toFixed(0);
console.log(window.audioTime);
console.log(window.audioDuration);
}
}