Controlling Multiple Sounds
Hey everyone I'm having a problem with controlling 3 different sound. Just to let you know I'm an amature at this actionscripting stuff so I try to find things that are already done and I can figure out how to tweek it for my needs. Well I'm using the code below for each sound and it works great until I click a button to go to the next sound. If the sound is still going from the first one - the next one will overlap. I'm trying to make the sound stop when I click a forward or back arrow while the next sound plays. Any help would be much appreciated. Thanks.
bgSound = new Sound(this);
itquit = false;
itgoes = true;
bgSound.attachSound("audio1");
bgSound.start();
slider.slideBar._x = -30;
function adjustVolume()
{
bgSound.setVolume(0 - 3.4 * this._x);
}
slider.slideBar.onEnterFrame = adjustVolume;
slider.slideBar.onPress = function()
{
slider.slideBar.onEnterFrame = adjustVolume;
startDrag(this, false, -30, 0, -3, 0);
};
slider.slideBar.onRelease = slider.slideBar.onReleaseOutside = function ()
{
stopDrag();
};
Btn_Mute.onPress = function()
{
if (bgSound.getVolume() != 0)
{
oldVolume = bgSound.getVolume();
slider.slideBar.onEnterFrame = null;
bgSound.setVolume(0);
}
else
{
slider.slideBar.onEnterFrame = adjustVolume;
bgSound.setVolume(oldVolume);
}
};