Overlapping Sound

Hello,

I have 4 sound files brought into Flash 5 and turned into movieclips. In the first frame of the mc’s I add :

if (_root.audio==0)
{
stop();
}

and a stop action on the last frame. I drag them onto the stage in sync with the text - and they play just fine. But, if i click the next button before the music has completed, the next track begins over the previous. How can make the audio from the previous stop when the next button is clicked? Anyone?

Below is what I have on each “next button”… except the gotoAndPlay info will change on each button of course.

on (rollOver) {
tellTarget ("_root.next movie") {
gotoAndPlay (“roll over”);
}
}
on (rollOut) {
tellTarget ("_root.next movie") {
gotoAndPlay (“roll out”);
}
}
on (release) {
gotoAndPlay (“sending information”, 222);
}

There’s a handy little function called stopAllSounds() or similar available in Flash 5. If you attach this to either the button that triggers each sound movie or the first frame of the sound movie itself, before your sound starts playing, this should solve the problem.

Hey,

Thanks for the help. But, I put StopAllSounds() in the music movieclip’s first frame and it simply stopped the music before it played, then I put it on the last frame and the same thing happened. I then placed it on the button, but it through an error. I also placed it on the timeline and it just stops the music before it plays…

Any thoughts anyone?

Thanks again,

Apertureboy

have you tried:

putting a blank frame1, with a stop, then telltarget with your button to goto frame2 and play on the new music, and telltarget to goto frame1 and stop on the one playing…

or maybe I don’t understand,

Rev

another way I have done this is to use loadmovie to place them in the same level, but this can be tricky to sync because of different d/l times. one way to get around this is to load them without playing once before you need them, then they are in the user’s cache (most users have at least 1 meg of cache), and will load a lot quicker the 2nd time around…

just a thought…

hope it helps,

Rev

Hi,

Thanks for all the suggestions…But i came up with a simple way and it seems to work. Instead of turning the audio clips into movieclips, I simply drag them onto the main scene after inserting a key frame and open the sound panel set it to Custom and stream. Now when I click on my next button the audio shuts off and the new audio begins - problem sloved!

Thanks again,

Robert