Hi
This might be a long shot as i dont know a thing about javascript but maybe someone here can help me out with whatever info i have to provide
I have a loading page with a progress bar / div that moves as the images are loading, when the images are all complete the loading bar flashes on and off using this >> setTimeout("loadObj.hide()",500) it also has var hide & var show further up the page setTimeout("loadObj.show()",500)
thats related to this
I want to add code to the show hide part so that when the div flashes a sound is also made at the same time using a wav or midi file. Does anyone have some code that would work using the same show hide method that the flashing div uses or something that can be grafted into the original code to do what im after?
Preferably i would like the sound to happen when the hide instruction is given and not when the show is used , that way it just does it once and stops after that ,otherwise it will be playing continuously
I have this code i found which works but you have to use a mouse to make it play
can it be modified to what i want? and can it be made so no mouse is needed? and it runs off the var hide command so i works when this original code setTimeout("loadObj.hide()",500) does?
i know this info is a bit vague especially with the originalcode i want to add to but since i dont know a thing about coding im trying to make it as less complicated for myself as i can by just inserting another piece and not re writing anything
<head>
<script>
var aySound = new Array();
aySound[0] = "MY_SOUND.wav";
document.write('<BGSOUND ID="auIEContainer">')
IE = (navigator.appVersion.indexOf("MSIE"))
{
auCon = IE? document.all.auIEContainer:auEmb;
auCon.control = auCtrl;
}
function auCtrl(whSound,play) {
if (IE) this.src = play? aySound[whSound]:'';
}
function playSound(whSound) { if (window.auCon) auCon.control(whSound,true); }
function stopSound(whSound) { if (window.auCon) auCon.control(whSound,false); }
</script>
</head>
<body>
<A HREF="javascript
laySound(0);">Click here to play sound</A>
</body>
thanks