|
How to check that sound is playing
Hello everybody!
I have a task to play a sound when mouse is moving. So the code is:
var plesk:Sound = new Sound();
plesk.onLoad = function(success:Boolean) {
if (success) {
plesk.stop();
}
};
// load the sound
plesk.loadSound("/sounds/MYSHKA.mp3", true);
myListener = new Object();
myListener.onMouseMove = function () {
plesk.start(0,1);
}
Mouse.addListener(myListener);
It sounds. But the problem is that it starts to play on every mouse movement. So it sounds argly bad because of overlaping. I understand that I have to check weather it's playing at the start of the mouse movement or not, but don't know how. Does anybody know how to solve this?
Thanx a lot
|