Click to See Complete Forum and Search --> : PLay WAV ONLY once on MouseMove...How?


AndyK
November 23rd, 1999, 05:28 PM
I know it's easy but I just can't get it :(..(I got it before to work, but something is wrong with me I guess....forgot!

BrewGuru99
November 23rd, 1999, 09:39 PM
I had a similar problem in Access. I wanted to set another object to visible when the control was passed over. And what happened was the other object (a square) would flicker for each movement of the mouse. I had several objects, each of which displayed a different square when passed over (and disappeared again when over another control or the form). I created a string that would be assigned the name of the control when the mouse entered it. I also had a sub that would make all the objects invisible, but I doubt you would need anything like that (mabey to stop another wav from looping).


Sub Object_MouseOver(...........)
...
If strCurrentControl <> Object.Name then
strCurrentControl = Object.Name
... Call ClearAll Sub
... Play sound, or in my case, make objects visible ...
...
End If
...
End Sub
'Note: I used this code in every object, including the form. If you don't,
' you can move the mouse on and off the object without re-triggering
' the desired effect.





Brewguru99

santulan
November 23rd, 1999, 10:24 PM
Andy,

Use the code below (Set it accordingly)

'on top of the form. This is public to form
Dim Played as Boolean
'In form load event
Played = false

'on form_mousemove event
if not played then
'Andy do what ever you do... :-)
'...
'...
Played = true
end if




I hope that work.

regards,

Santulan