<NPUT NAME=Sound1 TYPE=BUTTON VALUE="A Channel"
STYLE="position:absolute; LEFT:20; TOP:80; color:white;">
<INPUT NAME=Sound2 TYPE=BUTTON VALUE="B Channel"
STYLE="position:absolute; LEFT:20; TOP:120; color:white;">
<OBJECT ID="AM1" WIDTH=0 HEIGHT=0
STYLE = "visibility:hidden"
CLASSID="CLSID:05589FA1-C356-11CE-BF01-00AA0055595A">
<PARAM NAME="showcontrols" VALUE="false">
<PARAM NAME="showdisplay" VALUE="false">
<PARAM NAME="AutoStart" VALUE="false">
<PARAM NAME="AutoRewind" VALUE="false">
<PARAM NAME="PlayCount" VALUE="5">
<PARAM NAME="FileName" VALUE="bass.wav">
</OBJECT>
<OBJECT ID="AM2" WIDTH=0 HEIGHT=0
STYLE = "visibility:hidden"
CLASSID="CLSID:05589FA1-C356-11CE-BF01-00AA0055595A">
<PARAM NAME="showcontrols" VALUE="false">
<PARAM NAME="showdisplay" VALUE="false">
<PARAM NAME="AutoStart" VALUE="false">
<PARAM NAME="AutoRewind" VALUE="false">
<PARAM NAME="PlayCount" VALUE="5">
<PARAM NAME="FileName" VALUE="drums.wav">
</OBJECT>
<script language="VBScript">
' here we define a:
Dim achan ' bit to define whether channel A it is playing or not
Dim bchan ' bit to define whether channel B it is playing or not
achan=2 ' make sure if that if loading button is clicked it does not
bchan=2 ' try to play files before they are loaded, to avoid error
sub AM1_ReadyStateChange() 'This event is fired when Channel A Media (wave file) is finished loading
achan=0
sound1_onclick 'Make button display "play"
end sub
sub AM2_ReadyStateChange() 'This event is fired when Channel A Media (wave file) is finished loading
bchan=0
sound2_onclick 'Make button display "play"
end sub
' The following two routines take care of toggling the
' Buttons between their two states play and Stop
' as well as starting and stopping their respective
' ActiveMovie Control
Sub Sound1_onclick
select case achan
case 0:
AM1.Stop
Sound1.innerText="Play Channel A"
Sound1.style.backgroundColor="green"
achan = 1
case 1:
AM1.run
Sound1.innerText="Stop Channel A"
Sound1.style.backgroundColor="red"
achan = 0
end select
end sub
Sub Sound2_onclick
select case bchan
case 0:
AM2.Stop
Sound2.innerText="Play Channel B"
Sound2.style.backgroundColor="green"
bchan = 1
case 1:
AM2.run
Sound2.innerText="Stop Channel A"
Sound2.style.backgroundColor="red"
bchan = 0
end select
end sub
</SCRIPT>