Click to See Complete Forum and Search --> : Playing a WAV when mouse over a command button


Locust
September 21st, 1999, 01:44 PM
I would like to play a wav when the user moves over certain buttons. I tried to use the mousemove event on the buttons but this results in continuous play whenever the user moves anywhere within the button. I would like for the wav to be played just once. It's probably something easy but I've been banging my head away for the past 2 hours to no avail so any help would be appreciated. Thanks

czimmerman
September 23rd, 1999, 12:44 AM
First, see http://www.freevbcode.com/ShowCode.Asp?ID=19 for code showing you how to play a .wav file.

Second, the sound keeps playing because the mousemove event is fired each time you move your mouse over the control. You need to set a form level flag to true the first time the mouse move event is fired, and not play the .wav file when the flag is true. When the mouse moves out of the command button (i.e., any of the other form's elements, set the global flag back to false.

Charlie Zimmerman