Forum Moderators: open

Message Too Old, No Replies

Swapping out embeded src file based on select menu

         

Jeremy_H

4:37 am on Apr 9, 2006 (gmt 0)

10+ Year Member



I'm creating a page where a selected radio station from a select list will start to play when the page loads.

If another station is selected, then the old station will stop, and the new station starts automatically.

I have the two parts I need, (the selection menu, and the embeded file, but I don't know how to connect the two.)

Any help would be greatly appreciated. Thanks.

CODE:

<body OnLoad="document.radio.station.focus();">
<form name="radio">
<select name="station">
<option value="1.asx" selected="selected">Station 1</option>
<option value="2.asx">Station 2</option>
</form>
</select>
<embed src="1.asx" autostart="true"></embed>

phillipandrews

1:08 pm on Apr 10, 2006 (gmt 0)

10+ Year Member



<script language=javascript>
function changeStation(filename) {
//You're on your own here. I don't know what to do.
}
</script>
<body OnLoad="document.radio.station.focus();">
<form name="radio">
<select name="station">
<option value="1.asx" selected="selected" onclick="changeStation('1.asx')">Station 1</option>
<option value="2.asx" onclick="changeStation('1.asx')">Station 2</option>
</select>
</form>
<embed src="1.asx" autostart="true"></embed>