CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2002
    Location
    Scotland
    Posts
    12

    Play sounds from VBscript without displaying console

    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.

  2. #2
    Join Date
    Jul 2002
    Location
    Scotland
    Posts
    12

    Solution

    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">

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured