Forum Moderators: open
I have the following simple function to change the _alpha value.
function fadeIn() {
this._alpha += 25;
}
I assign this function to my movie clips:
greybar1_mc.onEnterFrame = fadeIn;
greybar2_mc.onEnterFrame = fadeIn;
menu_mc.onEnterFrame = fadeIn;
t_username.onEnterFrame = fadeIn;
The problem is that its all happening rather quickly.
Is it possible to adjust the speed and maybe also add an Easy In ?
Thanks!
var fadeIncrement:Number=25;
var fadeSpeed:Number=0.5;
then
greybar1_mc.onEnterFrame = setTimeout(_root.fadeSpeed,fadeIn());
greybar2_mc.onEnterFrame = setTimeout(_root.fadeSpeed,fadeIn());
menu_mc.onEnterFrame = setTimeout(_root.fadeSpeed,fadeIn());
t_username.onEnterFrame = setTimeout(_root.fadeSpeed,fadeIn());
and
function fadeIn() {
this._alpha += _root.fadeIncrememt;
}
This may not be entirely correct but is posted for an idea. The idea is you should be able to control the "fade speed" via setTimeout(). You may have to monitor the value of setTimeout and apply clearTimeout() to avoid recursive problems with setTimeout. See manual, don't have working code handy. :-)
Also note the movement of "25" to a variable that can be accessed by any object, this allows you to put all your variables in one place, frame 1 AS layer.