I have a function to fade in and out four movie clips. This is the code:
function fadeSub(l) {
for (k=0; k<but.length; k++) {
if (k != l) {
this["sub_"+but[k]].onEnterFrame = function() {
this._alpha += (0-this._alpha)/3;
if (this._alpha < 5 ) {
this._alpha = 0;
delete this.onEnterFrame;
}
};
} else {
this["sub_"+but[k]].onEnterFrame = function() {
this._alpha += (99-this._alpha)/12;
if (this._alpha > 98) {
this._alpha = 99;
delete this.onEnterFrame;
}
};
}
}
}
I call the function with:
clip.onRelease = function() {
fadeSub(this.i);
};
I have buttons inside the sub_mc’s that aren’t working because of the depths. How doI integrate a swapDepth in the fadeSub function?
Donald