Control sound through actionscript 2

Hello all,

I am using this code to control a sort of interactive slideshow.
I have an array which contains framelabels and when you press a button it moves on to the next framelabel


var labelArr:Array = ["frame1","frame2","frame3","frame4","frame5","frame6","frame7","frame8","frame1"]; 
var currentLabel:Number = 0;

next_btn.onRelease = function() {     
    if (currentLabel < labelArr.length - 1) {         
        currentLabel++;         
        gotoAndPlay(labelArr[currentLabel]);     
    }else{                 
        currentLabel = 0;         
        gotoAndStop(labelArr[currentLabel]);
    } 
}

What i want to do now is have sound fade in, loop while in “frame1” then fade out the sound from “frame1” and fade in the sound from “frame2” when the user clicks on the button to move on.

What i’ve tried doing this using


bgSound = new Sound(this);
bgSound.attachSound("bus_natural");
bgSound.start(0, 99);

to start the sound and then


this.onEnterFrame = function() {
    stopAllSounds();
}

to stop it. But i really need the fade in and out effect because the visual transition is gradual and the sound transition isn’t.

help :slight_smile: