C
Con
Hi, I'm getting the following error message in the JavaScript console:
Error: mus has no properties
Source File: file:///G:/temp/cafedub.htm
Line: 35
Now, I would like to script to work in both IE 6 and Netscape 7. The
goals of the script are as follows:
o when a music image is clicked, please the associated music without
looping
o if the same image is clicked again, then that music stops playing
o if another image is clicked, then it should stop all others and play
the
currently selected music link
o the script should play in the background while the page is displayed
BEGIN SCRIPT:
<script>
var musi;
var mus;
var songs = new Array();
songs[0] = "mp3/burt_lick_the_lishna_weenay.mp3";
songs[1] = "mp3/mouse_cant_tap.mp3";
songs[2] = "mp3/cool_and_keen,mp3";
songs[3] = "mp3/hollywood_poser_blues.mp3";
songs[4] = "mp3/suction_boy.mp3";
var isOn = new Array();
isOn[0] = false;
isOn[1] = false;
isOn[2] = false;
isOn[3] = false;
isOn[4] = false;
function mus1( musicNumber )
{
musi = songs[ musicNumber ];
if ( !isOn[ musicNumber ] ) {
mus.innerHTML="<embed src="+musi+" loop=-1>";
isOn[ musicNumber ] = true;
}
else {
mus.innerHTML = "";
isOn[ musicNumber ] = false;
}
}
document.write("<span id='mus'
style='position:absolute;top:-90000'><embed src="+musi+" width=0
height=0 loop=-1></span>");
END SCRIPT:
BTW, my links are developed as follows:
<a id="mus" href="javascript:void(0)" onclick="mus1( 2 )"><img
src="sound.gif"
width="16" height="16" border="0"></a>
If anyone has any ideas as to how to resolve this issue, please post to
the group.
Thanks in advance,
-Conrad
Error: mus has no properties
Source File: file:///G:/temp/cafedub.htm
Line: 35
Now, I would like to script to work in both IE 6 and Netscape 7. The
goals of the script are as follows:
o when a music image is clicked, please the associated music without
looping
o if the same image is clicked again, then that music stops playing
o if another image is clicked, then it should stop all others and play
the
currently selected music link
o the script should play in the background while the page is displayed
BEGIN SCRIPT:
<script>
var musi;
var mus;
var songs = new Array();
songs[0] = "mp3/burt_lick_the_lishna_weenay.mp3";
songs[1] = "mp3/mouse_cant_tap.mp3";
songs[2] = "mp3/cool_and_keen,mp3";
songs[3] = "mp3/hollywood_poser_blues.mp3";
songs[4] = "mp3/suction_boy.mp3";
var isOn = new Array();
isOn[0] = false;
isOn[1] = false;
isOn[2] = false;
isOn[3] = false;
isOn[4] = false;
function mus1( musicNumber )
{
musi = songs[ musicNumber ];
if ( !isOn[ musicNumber ] ) {
mus.innerHTML="<embed src="+musi+" loop=-1>";
isOn[ musicNumber ] = true;
}
else {
mus.innerHTML = "";
isOn[ musicNumber ] = false;
}
}
document.write("<span id='mus'
style='position:absolute;top:-90000'><embed src="+musi+" width=0
height=0 loop=-1></span>");
END SCRIPT:
BTW, my links are developed as follows:
<a id="mus" href="javascript:void(0)" onclick="mus1( 2 )"><img
src="sound.gif"
width="16" height="16" border="0"></a>
If anyone has any ideas as to how to resolve this issue, please post to
the group.
Thanks in advance,
-Conrad