PDA

View Full Version : Sound


Stoked
03-15-2003, 11:52 PM
Can anyone point me to a tutorial that can show me how to put a sound on a website with On/Off buttons?

Jesse
03-16-2003, 12:35 AM
I'm positive there'd be one at www.flashkit.com.

boyzdynasty
03-16-2003, 02:54 AM
mSound = new Sound();
mSound.loadSound("your.mp3", false);

mSound.start(0,1);


then...on a stop button


onPress = function () {
mSound.stop();
};


then...on a play button


onPress = function () {
mSound.start(0,1);
};


*Note: works only in FLASH MX

Stoked
03-16-2003, 08:18 PM
Thanx for the code but I have one more question. Instead of a stop button could I use a pause button? If so what is the code for that.

Thanx

boyzdynasty
03-17-2003, 12:52 AM
// pause instead of stop

onPress = function () {
pause = mSound.position();
mSound.stop();
};


Note: Declare the variable "pause" somewhere so the play button can access it too. And initialize it to zero.
*TIP >> declare it where you delcare the sound object.

// play button is now

onPress = function() {
mSound.start(pause/1000, 1);
}

bluegel
03-17-2003, 11:12 AM
there are lots of tutorials on sound on www.flashkit.com if you still are stuck after that

but what boyzdynasty said should work though


:)