Rewind audio and a linked animation when complete

(Tom) #1 (79.2 KB)
I have an audio file linked to an animated button. The button allows pause play and only animates when the audio is active. What I need is for the audio to rewind and the animation to stop once the audio has completed playing. I am having a time of it trying to get both to stop and rewind.

Any help is greatly appreciated! Thanks!! Tom

(Mark Hunte) #2

Change your audio_init_2() function to this.

window.my_audio_2 = hypeDocument.getElementById("my_audio_narration_2");
	//hypeDocument.getElementById("my_audio_narration_2").loop = true;
	hypeDocument.getElementById("my_audio_narration_2").volume= .5;
	window.my_audio_2.onended = function() {
   hypeDocument.functions().show_hide_narration_2(hypeDocument, element, event)

This listens to when the Audio has ended using the Ended / onended event function

Have a read through this

Triggering Audio in Chrome Mac problem
(Tom) #3

Thank you so much!!! and thanks for the link. Good resource.