Results 1 to 7 of 7

Thread: play 3 diffrent music on site

  1. #1
    Join Date
    Jan 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question play 3 diffrent music on site

    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)

  2. #2
    Join Date
    Dec 2005
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    <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="javascriptlaySound(0);">Play</a>
    <a href="javascript:stopSound(0);">Stop</a>

  3. #3
    Join Date
    Jan 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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?

  4. #4
    Join Date
    Jan 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool

    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

  5. #5
    Join Date
    Jan 2006
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default is this what your talking about??

    Quote Originally Posted by JRockZ
    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.

  6. #6
    Join Date
    Jan 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Code:
    <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>
    Last edited by jscheuer1; 02-01-2006 at 05:40 AM. Reason: Opera Tweaks
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •