I wrote these functions to fade 3 movieClips in and out. There are three buttons- 1, 2, and 3, and each fade in and out their relative movieclip.
The problem is that when I click through the buttons, sometimes one might fade in, but one of the others doesn’t fade out. Or sometimes the one that is supposed to fade out does, but it is delayed.
I can see what you are trying to do but how you have set the functions up, you are not deleting the onEnterFrame.(By the way changing _alpha is heavy on processor anyway)
Try changing to something like this
function fadeOut(z) {
z.onEnterFrame = function() {
if (this._alpha>50) {
this._alpha -= 10;
} else {
delete this.onEnterFrame;
}
};
}