Click to See Complete Forum and Search --> : multiple sources


hansfraatz
03-08-2005, 07:43 PM
ok heres the deal. im creating a website for college coursework. i do not have to upload it to a webhost but... i am adding a music function. i have got my homepage java scripted so that when the page loads another page appears with windows media player in it. so far i have got the buttons and i have got one song to play, here is the code:
<div align="center" id=vpdiv><embed name="RAOCXplayer" src="the black dahlia murder - unhallowed - apex.mp3" type="application/x-mplayer2" width="300" height="50" ShowControls="2" ShowStatusBar="1" AutoSize="true" loop="infinate" EnableContextMenu="0" DisplaySize="0" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/"></embed></div>

but so far i can only have one source and i am trying to get it so you can skip and cycle through 2 other tracks but i cannot find a way to add multiple sources. please can someone help me,

cheers.

p.s. i will add the user who helps me to the acknowledgements if thats any more incentive :D

liam

scragar
03-09-2005, 05:57 AM
<script type="text/javascript">
<!--
var k = 0;
var songs = new Array("the black dahlia murder - unhallowed - apex", "the black dahlia murder - unhallowed - apex");
var Max = songs.length;
function ChangeSource(i){
if(i == -1 && k == 0){
alert("that is the first song.");
}else{
if(i == 1 && k == Max){
alert("that is the last song.");
}else{
k = k + i;
RAOCXplayer.src = songs[k] + ".mp3";
};
};
songNo.value = k+1;
};
//-->
</script>
<div align="center" id=vpdiv><embed id="RAOCXplayer" name="RAOCXplayer" src="the black dahlia murder - unhallowed - apex.mp3" type="application/x-mplayer2" width="300" height="50" ShowControls="2" ShowStatusBar="1" AutoSize="true" loop="infinate" EnableContextMenu="0" DisplaySize="0" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/"></embed></div>
<div align=center>
<input type="button" name="leftSearch" value="<=" onclick="ChangeSource(-1);" />
<input type="text" name="songNo" value="1" readonly disabled/>
<input type="button" name="rightSearch" value="=>" onclick="ChangeSource(1);" />
</div>