I'm trying to do something a little unique and I'm sure it can be done because I'm already quite close. I'm trying to write a code that will first, look to see if the "continue" radio button is checked (that part works). Then it needs to check if the media's playState is == 1 (that part works, too). Here's where my code goes a little wacky -- I need it to advance to the next select option in the select list and play it after meeting the above conditions and auto select the option that is playing. My code does advance to and play the next song and even moves the selected focus to the item in the list, but afterward it just keeps playing the second item and doesn't continue down the list. Code is below, any thoughts??
//Continue() is called from "playSound()" which is
//called by the "play" button.
function Continue() {
if (document.cPlay.cButton[0].checked == true) {
playNext(); //if continuous play is checked, move on..
}
}
function playNext()
{
//playList is the form.select object
var playList = document.amp.playlist;
if (MediaPlayer.playState == 1) //if player is stopped
{
for(var i = 0; i < playList.options.length - 1; i++)
{
var next = playList.options.value;
MediaPlayer.URL = next; //song to play next
MediaPlayer.Controls.Play(); //Play current song
//make the current song the selected option
playList.options.selected = playList.options[i+1];
}
}
//if the playState
setTimeout('Continue()',1000);
}
Please help!
Thanks - LAwebTek
//Continue() is called from "playSound()" which is
//called by the "play" button.
function Continue() {
if (document.cPlay.cButton[0].checked == true) {
playNext(); //if continuous play is checked, move on..
}
}
function playNext()
{
//playList is the form.select object
var playList = document.amp.playlist;
if (MediaPlayer.playState == 1) //if player is stopped
{
for(var i = 0; i < playList.options.length - 1; i++)
{
var next = playList.options.value;
MediaPlayer.URL = next; //song to play next
MediaPlayer.Controls.Play(); //Play current song
//make the current song the selected option
playList.options.selected = playList.options[i+1];
}
}
//if the playState
setTimeout('Continue()',1000);
}
Please help!
Thanks - LAwebTek