Click to See Complete Forum and Search --> : Play sounds from VBscript without displaying console


Dougie
March 5th, 2003, 04:04 AM
I want to allow viewers of a web page to select a sound by clicking on a radio button and then play that sound by clicking another button. I don't want the screen display to change from the page they are viewing, i.e. I don't want that ghastly Media Player console to launch. How can I do this with VBscript?

d.

Dougie
March 5th, 2003, 07:19 AM
I figured it out myself. In case it helps anyone else, this works in IE6.


<!-- this loads the sound silently -->

<embed id="sndTest" src="windows logon sound.wav" hidden="true" autostart="false">

<!-- and clicking this will play it -->

<input type="button" id="btnPlay" value="Play" onClick="VBscript:sndTest.play">