[AS2] Disable buttons for a length of time, then enable them again

Hi

I’m using this script to go between sections with a fade out before loading the next section…


stop();
menuButton1.onRelease = function() {
    loadPage("content/plan.swf");
};
menuButton2.onRelease = function() {
    loadPage("content/build.swf");
};
menuButton3.onRelease = function() {
    loadPage("content/images.swf");
};

function loadPage(pageName) {
    movContainer.gotoAndPlay("out");

    this.onEnterFrame = function() {
        if (movContainer._currentframe == movContainer._totalframes) {
            delete this.onEnterFrame;
            movContainer.loadMovie(pageName);       
        }
    };
}

… which works great, playing the “out” fade-out before loading the next section, but if for example the fade-out takes 8secs, if someone presses one of the other buttons before its got to the end, it plays from the “out” label again. So if someone gets inpatient and just starts clicking away they will just keep looping the fade-out and nothing will load.

Is there a way to disable the buttons after pressing for long enough for the fade-out, but then become active again? If its something that could work with my existing code that would be great.

Thanks
Wayne