playsound("abc.wav") meets your request and works ok
the problem is from OnMouseMove Function:
if you don't move your mouse (your mouse stay on Object without movement) it still run the function multiple times.
This means when you are inside object it will play a moment of sound multiple times and maybe you don't hear that (because it's too little that sounds a noise) and when you get out of object it will get out of last function and you hear last play fully played
i tested with PhotoAlbum and !Next Command in the OnMouseMove Function:
Even when don't move the mouse it will do !Next until i get out of the Object
=============
Solution:use your own sound in [yoursound.wav] and create an empty sound for [empty.wav] and use following code:
Code:
var x1=0
var y1=0
function text1OnMouseMove(Sender,Shift,X,Y,Dx,Dy)
{
if(X!=x1|Y!=y1) //Only Play if Mouse Moves
{
PlaySound("yoursound.wav")
}
else //to Stop sound when Stop Mouse Movement
{
PlaySound("empty.wav")
}
x1=X
y1=Y
}
//to prevent last play after getting out of object
//remember to set text1OnMouseLeave in OnMouseLeave of Object
function text1OnMouseLeave(Sender)
{
PlaySound("empty.wav")
}