Everything is going haywire

I’m making a mp3 player using flash. when i test the movie it starts playing fine but when i click the next button the current track keeps playing while the next one starts. plus the stop button it’s not working. here is the code.


var playing:Boolean = false;
var pausePoint:Number = 0;


playpause_button,addEventListener(MouseEvent.CLICK, playpauseButtonClick);
function playpauseButtonClick(m:MouseEvent):void {
    playing = playing ? false : true;
    if (playing) {

        theChannel = theSound.play(pausePoint);
    } else {

        pausePoint = theChannel.position;
        theChannel.stop();
    }
}

prev_button.addEventListener(MouseEvent.CLICK, prevButtonClick);

function prevButtonClick(event:MouseEvent):void {

    if (b > 1) {
        b = b - 1;
        theChannel.stop();
        gotoAndPlay("startTrack");
    } else {
        b = this.totalfiles;
        theChannel.stop();
        gotoAndPlay("startTrack");
    }
}


next_button.addEventListener(MouseEvent.CLICK, nextButtonClick);

function nextButtonClick(event:MouseEvent):void {

    if (b < this.totalfiles) {
        b = b + 1;
        theChannel.stop();
        gotoAndPlay("startTrack");
    } else {
        b = 1;
        theChannel.stop();
        gotoAndPlay("startTrack");
    }
}


Thanks in advance.