I was testing this code out but i didnt get it to work as i wanted.
I have 4 mc in my _root (mc_clip1-mc_clip4). Clip1 is at 100% alpha, the rest is hidden ( in this syntax i only have 2 clips)
Iw hidden the second clip,
clip2._alpha = 0;
and function fadeIn is suppose 2 fade in clip 2
and funktion fadeOut is suppose 2 fade out clip 1
BUT when i use these 2 lines,ony one funtion works
my_mc.onRelease = fadeOut;
my_mc.onRelease = fadeIn;
how can i solve this problem? the thing is that i need 2 more clips (4 in total) that needs 2 be given functions so they can hide and show clips.
One button has 2 objectivs: hide the clip that is 100% alpha and show the target clip 0-100% alpha.
Realy hope that someone can help me
clip2._alpha = 0;
Button.prototype.fadeIn = MovieClip.prototype.fadeIn = function () {
//trace("fadeIn called on "+this);
this.onEnterFrame = function () {
if (clip2._alpha<100) {
//trace("fade-ing in! alpha = "+this._alpha);
clip2._alpha += 10;
} else {
delete this.onEnterFrame;
//trace("DONE! Ended on alpha "+this._alpha);
}
};
};
Button.prototype.fadeOut = MovieClip.prototype.fadeOut = function () {
//trace("fadeOut called on "+this);
this.onEnterFrame = function () {
if (clip1._alpha>0) {
//trace("fade-ing out! alpha = "+this._alpha)
clip1._alpha -= 10;
} else {
delete this.onEnterFrame;
//trace("DONE! Ended on alpha "+this._alpha);
}
};
};
my_mc.onRelease = fadeOut;
my_mc.onRelease = fadeIn;