Originally Posted by xelawho
but equally. the audio tag exists independently of the pictures or text or whatever that is used to trigger playback. Maybe I'm being thick, but I still can't see why you need multiple audio tags when you can just have all your onclicks pointing towards one element.
if you really do need to go down the multiple audio tags road, I would suggest setting a variable that "remembers" which element was the last one played, then calling pause on that one before beginning playback on the new one.
Okay. So, what your saying is, I need to have only ONE audio element, and depending on what the user clicks, change the src of the element, reload, set time to zero, then play?
So, I will put the src into the "id:" spot instead, and then simply call the audio element a second time (with a new src now). Hopefully, this second call will halt the first audio from playing?
I think I was being thick by defining multiple audio tags before....
But if I did continue down the multiple audio tag route...shouldn't what I had above do the same thing as having memory? (ie stopping everything regardless?)