Forum Moderators: open
i found an article that dealt with this, but was not able to reproduce it:
[boutell.com...]
the Stop() function worked for me, but the Play(), Rewind() en DoPlay() didn't.
So i came up with another solution, that is far less elegant, but it does work :-)
define your mp3 as follows:
<div id="mp3container">
<EMBED SRC="song1.mp3" autostart="true" id="mp3song"/>
</div>
<a href="#" onClick="swapMP3();">swap</a>
and create this function:
<script type="text/javascript">
function swapMP3()
{
document.getElementById('mp3container').innerHTML = '<EMBED SRC="song2.mp3" autostart="true" id="mp3song" />';
}
</script>
this causes the whole embed-tag to be replaced by a different one, containing the new song