PDA

View Full Version : FP2002 | Toggle Music


polo
12-07-2002, 07:30 AM
Using FP to create a slideshow with a background music loop. Need to use FP <BGSOUND SRC="file.wav" --- (can not use EMBED in this instance) . . . .

Is there a JS to toggle the sound on/off?

Thank in advance.

zoobie
12-07-2002, 08:49 AM
Try:

<head>
<SCRIPT>
function playSound(){
document.music.play();
}
function stopSound(){
document.music.stop();
}
</SCRIPT>
</head>

<body>
<bgsound SRC="sound.mp3" autostart=false HIDDEN=TRUE NAME="music">

<a href="#null" onclick="playSound();return false">PLAY SOUND</a>

<a href="#null" onclick="stopSound();return false">STOP SOUND</a>

</body>
</html> :D

polo
12-08-2002, 05:46 AM
Tried the following:

<html>

<head>
<SCRIPT>
function playSound(){
document.music.play();
}
function stopSound (){
document.music.stop();
}
</SCRIPT>
</head>

<body>
<bgsound SRC="Sound/Badu%20-%20Home_page.wav" autostart=false LOOP=15 HIDDEN=TRUE NAME="music">
<a href="#null" onclick="playSound();return false">PLAYSOUND</a>
<a href="#null" onclick="stopSound();return false">STOP SOUND</a>

</body>
</html>

I get an error on PLAY and STOP. on STOP I get:

document.music is null or not an object

Further help very much appreciated (once again). Thanks