Hello everyone … this is my first post. Thanks for a great forum!
I am just getting started in the actionscript world, and could use some advice. I have searched for info about pausing in the middle of the script, and have messed with setInterval to try to make this script work, but with no luck.
This is based on an older post by [COLOR=sienna]lostinbeta[/COLOR], and I have messed with it enough that, for the most part, it will do what I want it to do, which is to fade in then fade out text mc’s . I just need it to be a little more flexible so that I can hold onto 100% alpha longer before the clip begins to fade out. The slowest timing (1) works great, but I would like to be able to have more control. Also I was hoping to be able to keep this as one function, rather than a seperate function for both fadeIn & fadeOut.
I am using Flash 8 Pro.
MovieClip.prototype.fade = function(maxAlpha, minAlpha, speed){
this._alpha = 0;
this.onEnterFrame = function() {
if (!this.trigger) {
this._alpha += speed;
if (this._alpha>=maxAlpha) {
this._alpha = maxAlpha;
this.trigger = true;
}
// [COLOR=red]put a delay of variable # of seconds here, then continue[/COLOR]
} else if (this.trigger) {
this._alpha -= speed;
if (this._alpha<=minAlpha) {
this._alpha = minAlpha;
this.trigger = false;
delete this.onEnterFrame;
}
}
};
};
NameOfMovieclip.fade(99, 1, 1);
Thanks for any advice and wisdom.
Cheers, Garry