Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Oct 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Play song that is selected in a dropdown menu

    Can someone please fix this script for me? I don't know what I did wrong. The script is supposed to play the song you select from the dropdown menu when you hit play, and stop when you hit the stop button. Here it is:
    Code:
    <script language="javascript">
    var aySound = new array();
    sound[1] = "test1.mp3";
    sound[2] = "test2.mp3";
    sound[3] = "test3.wma";
    sound[4] = "test4.mp3";
    sound[5] = "test5.mp3";
    document.write('<BGSOUND ID="auIEContainer">')
    IE = (navigator.appVersion.indexOf("MSIE")!=-1 && document.all)? 1:0;
    NS = (navigator.appName=="Netscape" && navigator.plugins["LiveAudio"])? 1:0;
    ver4 = IE||NS? 1:0;
    onload=auPreload;
    function auPreload() {
    if (!ver4) return;
    if (NS) auEmb = new Layer(0,window);
    else {
    Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>";
    document.body.insertAdjacentHTML("BeforeEnd",Str);
    }
    var Str = '';
    for (i=0;i<aySound.length;i++)
    Str += "<EMBED SRC='"+aySound[i]+"' AUTOSTART='FALSE' HIDDEN='TRUE'>"
    if (IE) auEmb.innerHTML = Str;
    else {
    auEmb.document.open();
    auEmb.document.write(Str);
    auEmb.document.close();
    }
    auCon = IE? document.all.auIEContainer:auEmb;
    auCon.control = auCtrl;
    }
    function auCtrl(whSound,play) {
    if (IE) this.src = play? aySound[whSound]:'';
    else eval("this.document.embeds[whSound]." + (play? "play()":"stop()"))
    }
    function playSound(whSound) { if (window.auCon) auCon.control(whSound,true); }
    function stopSound(whSound) { if (window.auCon) auCon.control(whSound,false); }
    //-->
    </script>
    <form>
    <select name="song">
    <option playSound(1)>Test1</option><option playSound(2)>Test2</option><option playSound(3)>Test3</option><option playSound(4)>Test4</option><option playSound(5)>Test5</option>
    </select>
    <br><input type=submit value="play">
    </form>
    <img src="stop.gif" onmousedown="stopsound()">
    Thanks,
    littlehank
    Last edited by littlehank; 10-22-2005 at 11:40 PM.

  • #2
    New Coder
    Join Date
    Oct 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry

    Doesn't anybody know???????? PLEASE HELP MEEEE!!!!!!!!!

  • #3
    New Coder
    Join Date
    Oct 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    why do they even make these forums, if no one ever responds? PLEASE HEEEELP!

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Lets see, first post 5:49pm, second post 7:22pm, third post 8:20pm. You haven't been patient at all. We aren't here 24/7. You would have found your answer on your own if you had just searched. There is a whole thread that deals with nothing but embedded media players some with playlists some without. Some with a drop down menu and some without. http://www.codingforums.com/showthread.php?p=367461

  • #5
    New Coder
    Join Date
    Oct 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    sorry. I'm just used to other forums I use where there are people there 24/7. I'm new here


  •  

    Posting Permissions

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