PDA

View Full Version : Making script loop !


spazzer
02-23-2010, 06:41 PM
Hi all,
I have used this script to play a sound on my website but I would like it to loop the .wav file I have can anyone advise I have posted code below ?
<!-- Functions Code Block Start-->
<script>
/* Here we are creating two functions. The first to start a sound object playing and the second to stop a sound object from playing. */
//
// This function, when called will play the sound object
function EvalSoundPlay(soundobj) {
var thissound= eval("document."+soundobj);
thissound.Play();
}
// This function, when called will stop the sound object
function EvalSoundStop(soundobj) {
var thissound= eval("document."+soundobj);
thissound.Stop();
}
</script>
<!-- Functions Code Block End-->
<!-- Here we are embedding the sound file/s. We give each embedded sound a 'name' that we can refer to in a JavaScript event call.
-----
// Note: You can have multiple sounds embedded but remember that each sound requires a different 'name' and each would require its own set of play/pause buttons. -->
<embed src="Smooth_Ambience.wav" autostart=false width=0 height=0 name="sound1" enablejavascript="true" />
<!-- This is an example of a second embedded sound. -->
<embed src="jingle_bell_rock.mp3" autostart=false width=0 height=0 name="sound2" enablejavascript="true" />

davidj
02-24-2010, 10:45 AM
try

<embed src="Smooth_Ambience.wav" autostart=false width=0 height=0 name="sound1" enablejavascript="true" loop="true" />