View Full Version : play 3 diffrent music on site
GirlKillu
01-06-2006, 01:04 PM
hello,
i'm looking for a code/script where i can play 3 diffrent music files (.mp3) with, like i have 3 buttons 1 2 3 and when you click on one of those buttons you will hear that music what is linked to it... and also that each song have to repeat itself. and 1 stop button would also be usefull :)
if somebody can help me with this , i'd thank you very much :)
(ex: www.dewithoef.be see at bottom)
<script type="text/javascript">
function playSound(what) {
document.embeds[what].play();
}
function stopSound(what) {
document.embeds[what].stop();
}
</script>
<embed src="blablabla.mp3" autostart="false" loop="infinite"> //document.embeds[0]
<a href="javascript:playSound(0);">Play</a>
<a href="javascript:stopSound(0);">Stop</a>
GirlKillu
01-08-2006, 02:37 PM
hmm, thanks , but it doesnt seem to work realy , and that is for only 1 file i think
and what do you mean with the "what" between the brackets? (what) [what]
i have to put the filename in there?
JRockZ
01-27-2006, 11:27 PM
Check out my Fourms here http://orlandorockstop.proboards41.com/index.cgi right click to view source and find the code you need. Its been along time since i have entered that code so im not sure what it was or how i did it .
Good Luck
XXSUPERHEROXX
01-31-2006, 01:46 PM
Check out my Fourms here http://orlandorockstop.proboards41.com/index.cgi right click to view source and find the code you need. Its been along time since i have entered that code so im not sure what it was or how i did it .
Good Luck
Is this the part you told us to go look at???
<td height=3><center>Submitted by The Buzz Band www.thebuzzband.net</center></td>
<center>
<table cellspacing=4 cellpadding=4 border=3 style="border-color: FFFFFF"><tr>
<td border=3><embed src="http://www.thebuzzband.net/drumcut.mp3" height=20 width=160 autoplay=false /></td>
<td border=3><embed src="http://www.thebuzzband.net/buzcut1.mp3" height=20 width=160 autoplay=false /></td>
<td border=3><embed src="http://www.thebuzzband.net/buzcut2.mp3" height=20 width=160 autoplay=false /></td>
</tr>
<tr>
<td height=15><center>The Buzz Band Drum Cut</center></td>
<td height=15><center>The Buzz Band 1</center></td>
<td height=15><center>The Buzz Band 2</center></td>
</table>
</center>
<br /><br />
<!-- End Music Center -->
ok well dont know if its my browser or your site but your sites music sound like a skipping cd.
GirlKillu
01-31-2006, 04:01 PM
yes, but this part i could also make. but the problem here is, the 3 sounds play together, its not when you press nr2 that nr 1 and 3 will stop playing.. they now just keep playing :)
jscheuer1
01-31-2006, 05:11 PM
<embed style="z-index:-100;position:absolute;top:-1000px:left:-1000px;" id="sound1" src="some1.mp3" loop="true" autostart="false" hidden="true" enablejavascript="true">
<embed style="z-index:-100;position:absolute;top:-1000px:left:-1000px;" id="sound2" src="some3.mp3" loop="true" autostart="false" hidden="true" enablejavascript="true">
<embed style="z-index:-100;position:absolute;top:-1000px:left:-1000px;" id="sound3" src="some3.mp3" loop="true" autostart="false" hidden="true" enablejavascript="true">
<script type="text/javascript">
var sounds=document.getElementsByTagName('embed');
function silent(){
for (var i_tem = 0; i_tem < sounds.length; i_tem++)
if ( /sound/.test(sounds[i_tem].id) )
sounds[i_tem].Stop();
}
for (var i_tem = 0; i_tem < sounds.length; i_tem++)
if ( /sound/.test(sounds[i_tem].id) )
document.write('<input type="button" value="Play '+sounds[i_tem].getAttribute('src').replace(/.*\/|\..*(?!\.)/g, "").substr(0,7)+'" onclick="silent();document.getElementById(\''+sounds[i_tem].id+'\').Play();"> <input type="button" value="Stop '+sounds[i_tem].getAttribute('src').replace(/.*\/|\..*(?!\.)/g, "").substr(0,7)+'" onclick="document.getElementById(\''+sounds[i_tem].id+'\').Stop();"><br>')
</script>
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.