Hello to all,
Wondering if anyone out there could give me some info. on using JavaScript to control volume. I can't get an answer anywhere.
I have already set the volume icons in place, however, I continue to get an error when using the following code:
<script language="JavaScript">
function changeVolume(step) {
var vol = document.firstsound.GetVolume();
vol += step;
if (vol > 100) vol = 100;
if (vol < 0) vol = 0;
setVolume(vol);
}
function setVolume(vol) {
document.firstsound.setvol(vol);
}
.
.
.
</script>
<body>
.
.
.
<img src=http://www.webdeveloper.com/forum/archive/index.php/"/VolDown.GIF" width="116" height="58" style="cursor:hand" alt="Volume Down" border="0" onMouseOver="changeVolume(-10)">
.
.
.
<img src="/VolUp.gif" width="114" height="59" style="cursor:hand" alt="Volume Up" border="0" onMouseOver="changeVolume(10)">
.
.
.
</body>
When I went to test this, I got an error. It was a no go. The error was from this line:
var vol = document.firstsound.GetVolume();
and it said:
"'document.firstsound' is null or not an object"
Anyone have any ideas?
Thank you very much for your time and your help.
~dmason165
Wondering if anyone out there could give me some info. on using JavaScript to control volume. I can't get an answer anywhere.
I have already set the volume icons in place, however, I continue to get an error when using the following code:
<script language="JavaScript">
function changeVolume(step) {
var vol = document.firstsound.GetVolume();
vol += step;
if (vol > 100) vol = 100;
if (vol < 0) vol = 0;
setVolume(vol);
}
function setVolume(vol) {
document.firstsound.setvol(vol);
}
.
.
.
</script>
<body>
.
.
.
<img src=http://www.webdeveloper.com/forum/archive/index.php/"/VolDown.GIF" width="116" height="58" style="cursor:hand" alt="Volume Down" border="0" onMouseOver="changeVolume(-10)">
.
.
.
<img src="/VolUp.gif" width="114" height="59" style="cursor:hand" alt="Volume Up" border="0" onMouseOver="changeVolume(10)">
.
.
.
</body>
When I went to test this, I got an error. It was a no go. The error was from this line:
var vol = document.firstsound.GetVolume();
and it said:
"'document.firstsound' is null or not an object"
Anyone have any ideas?
Thank you very much for your time and your help.
~dmason165