View Single Post
  #1 (permalink)  
Old Nov 24th, 2005, 09:27
alexvesna alexvesna is offline
New Member
Join Date: Nov 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
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
Reply With Quote