Hey everyone. Im not the best actionscripter but i figure my way out of things.
Heres my question about oddly enough a working script. heh…
I made a button that fades up a movieclip and then the movieclip keeps fading down and up until on rollout where it fades it down. Now, i use a delete this.onEnterFrame; on the fade out button but im not sure if i should delete this.onEnterFrame in the functions where i fade up and down aswell. If so where/how?
Also, you guys probably know a better solution for this so feel free to post that aswell, but pls post answer for the first question aswell so i learn it. (Im probably doing something wrong too, as always.)
Here is the AS:
fadein = function(){
if (white_1._alpha<=100) {
white_1._alpha += 5;
} else{
this.onEnterFrame = fadeout;
}
}
fadeout = function(){
if (white_1._alpha>=0) {
white_1._alpha -= 5;
} else{
this.onEnterFrame = fadein;
}
}
fadeout2 = function(){
if (white_1._alpha>=0) {
white_1._alpha -= 5;
} else{
delete this.onEnterFrame;
}
}
And for the button:
on(rollOver){
this.onEnterFrame = function(){
fadein();
}
}
on(rollOut){
this.onEnterFrame = function(){
fadeout2();
}
}
Thanks for any help!