Hi,
Not sure if the problem is Javascript, but seems plausible. I am a complete noob to Javascript.
I have a page with some mp3 audio. Rough working version can be found here. All the buttons call the same sound at the moment, it's not a bug.
The sound works fine when I test locally in browsers but when it is on the site the sound stops after a couple of seconds.
If I click continuously the sound keeps going!
Any ideas?
I am using script
embedding the sound
then calling it like this
Not sure if the problem is Javascript, but seems plausible. I am a complete noob to Javascript.
I have a page with some mp3 audio. Rough working version can be found here. All the buttons call the same sound at the moment, it's not a bug.
The sound works fine when I test locally in browsers but when it is on the site the sound stops after a couple of seconds.
If I click continuously the sound keeps going!
Any ideas?
I am using script
Code:
<script>
function EvalSound(soundobj) {
var thissound=document.getElementById(soundobj);
thissound.Play();
}
function EndSound(soundobj) {
var thissound=document.getElementById(soundobj);
thissound.Stop();
}
</script>
Code:
<embed src="uploads/2ndGraders.mp3" autostart=false width=0 height=0 id="sound1"
enablejavascript="true"></embed>
Code:
<INPUT TYPE="image" SRC="uploads/microphone-icon-64.jpg"
ALT="PLay Sound" NAME="Submit now" onClick="EvalSound('sound1')">
<INPUT TYPE="image" SRC="uploads/microphone-icon-64x.jpg"
ALT="Stop Sound" NAME="Submit now" onClick="EndSound('sound1')">