Start/Stop a sound with MouseWithin and MouseLeave
Posted: Sun Nov 10, 2013 12:24 pm
Hello from France,
Great software LiveCode ! I'm using the 6.5 version on windows 7
I would like to start a sound when I put the mouse on an image and stop it immediatly when the mouse is out of the image.
I did this first step and there's yet a problem :
On MouseWithin
play audioClip "C:\TEST\hello.wav"
end MouseWithin
=> When the mouse is on the image, the sound starts. But not one time ! It starts again and again quickly and the sound is never entirely heard (it's a 5 seconds sound that is heard during maybe 0,10 seconds only !).
Is it a bug ? I want it to start it just one time.
It doesn't mean that I don't want to hear it many times after it stars one time ! (for example using "looping").
If I do this next :
On MouseWithin
play audioClip "C:\TEST\hello.wav"
wait until the sound is done
end MouseWithin
On MouseLeave
play stop
end MouseLeave
=> when the mouse is on the image the sound starts one time (no perpetual repeats) but it doesn't stop when I leave the image !
I tried many many things like using "if" loop but there's alaways something that doesn't do what I want.
Any idea ?
Thank you very much. Stéphane.
Great software LiveCode ! I'm using the 6.5 version on windows 7
I would like to start a sound when I put the mouse on an image and stop it immediatly when the mouse is out of the image.
I did this first step and there's yet a problem :
On MouseWithin
play audioClip "C:\TEST\hello.wav"
end MouseWithin
=> When the mouse is on the image, the sound starts. But not one time ! It starts again and again quickly and the sound is never entirely heard (it's a 5 seconds sound that is heard during maybe 0,10 seconds only !).
Is it a bug ? I want it to start it just one time.
It doesn't mean that I don't want to hear it many times after it stars one time ! (for example using "looping").
If I do this next :
On MouseWithin
play audioClip "C:\TEST\hello.wav"
wait until the sound is done
end MouseWithin
On MouseLeave
play stop
end MouseLeave
=> when the mouse is on the image the sound starts one time (no perpetual repeats) but it doesn't stop when I leave the image !
I tried many many things like using "if" loop but there's alaways something that doesn't do what I want.
Any idea ?
Thank you very much. Stéphane.