Newbie button and sound sample play help required.
Hi,
I am starting using MMF2 and I have a question.
I created a button that each time is clicked it plays a WAV sample and it works.
My question is how to stop any other sound playing and then play the sound associated to the button ?
Basically I would like that each time the button is clicked it :
1. Stop all sound playing
2. Plays the sound I've associated to the button...
Any help would be appreciated.
Re: Newbie button and sound sample play help required.
There is an action called "Stop any sample playing". You should use this, and then play the sound you want to play.
You have to do it in that order though, but it can still be in the same event.
Example:
* Button pressed
- Samples: Stop any sample playing
- Samples: Play sample "Hurray"
That should work.
If you do the actions the other way round, it will first attempt to play sample "Hurray", and then stop all samples, including the one started in the same event.
Re: Newbie button and sound sample play help required.
Thanks it works !...
Another and last question...
I would like to play a sample when the button is pressed and stop the sound when the button is released, is there an there a way to do that ?
Thanks
Re: Newbie button and sound sample play help required.
The button object is rather limited and clumsy to work with. I think you would be better off using an active object or an Active system box as the button.
Here's the events I would use with an Active object.
* User click with left button on "MyActiveButton"
- MyActiveButton: Set flag 0 on
- Play sample "Hurray"
* [Negate] Repeat while left mouse-key is pressed
+ MyActiveButton: Flag 0 is on
- MyActiveButton: Set flag 0 off
- Samples: Stop sample "Hurray"
Re: Newbie button and sound sample play help required.