Thanks to all who helped. It looks like I figured out what the problem was, with the use of mozilla's DOM inspector, js debugger, and JSIDE (a javascript ide) that I downloaded after googling "javascript ide" (it appears to be quite good). In any case, the whole issue was checking whether or not playable was empty. I used a single = instead of 2:
<object id=darkplayer codeBase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701 type=application/x-oleobject height=0 standby="Loading Microsoft Windows Media Player components..." width=0 classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95> <PARAM NAME VALUE> <PARAM NAME="ShowControls" VALUE="0"> <PARAM NAME="ShowStatusBar" VALUE="0"> <PARAM NAME="ShowDisplay" VALUE="0"> <PARAM NAME="DefaultFrame" VALUE="Slide"> <PARAM NAME="Autostart" VALUE="1"> <PARAM NAME="Loop" VALUE="False"> </object> <form name=form> <p style="text-align: center"> <select style="FONT-SIZE: 8pt; BACKGROUND:#FFFFFF; WIDTH: 302; COLOR: #00000; font-face: verdana;" name=playlist size=1> <option value="0">removed</option> </select><br> <input TYPE="BUTTON" NAME="darkplay" VALUE="we're at a place" OnClick="play(document.forms['form'].playlist);playstate=0;"> <input TYPE="BUTTON" NAME="darkpause" VALUE="called vertigo" OnClick="document.darkplayer.pause(); playstate=1;"> <input TYPE="BUTTON" NAME="darkstop" VALUE="contestar" OnClick="document.darkplayer.stop(); playstate=2;"> <input TYPE="BUTTON" NAME="random" VALUE="and i feel" OnClick="randsong();play(document.forms['form'].playlist);"> </p></form> <script language="JavaScript"> <!-- var playstate = 0; shuffle = 1; // set to 0 to always play first song in list // set to 1 to randomly choose the first song to play // www.xanga.com/singing_duck // unlimited songs, just copy and paste the song line and change the number songs=new Array(); songs[0]="removed" playable = new Array(); for (i = 0; i < songs.length; i++) { playable[i] = songs[i]; } function index(ar, text) { for (i = 0; i < ar.length; i++) { if (ar[i] == text) { return i; } } return -1; } function randsong() { rnd.today=new Date(); rnd.seed=rnd.today.getTime(); function rnd() { rnd.seed = (rnd.seed*9301+49297) % 233280; return rnd.seed/(233280.0); }; function rand(number) { return Math.ceil(rnd()*number); }; if (playable.length *=*= 0) { *// here's where the issue was. since i assigned* for (i = 0; i < songs.length; i++) { *// playable.length to 0, there were no songs in* playable[i] = songs[i]; *//* *it, resulting in index() returning -1, which threw off ...* } } var randsg = rand(playable.length); document.darkplayer.FileName = playable[randsg]; document.darkplayer.scr = playable[randsg]; document.forms['form'].playlist.options[index(songs,playable[randsg])].selected = true; *// ...this line, * playable.splice(randsg,1); *// **which expects a valid index (non-negative)* }; if (shuffle == 1) { randsong(); } function play(list) { if (playstate == 1 && songs[list.options[list.selectedIndex].value] == document.darkplayer.FileName) { document.darkplayer.Play(); } else { var snum = list.options[list.selectedIndex].value document.darkplayer.FileName = songs[snum]; document.darkplayer.scr = songs[snum]; } playstate = 1; }; //--> </script> -- Email: singingxduck AT gmail DOT com AIM: singingxduck Programming Python for the fun of it. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor