Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

adjust speed of alpha change?

7:30 pm on Jan 11, 2010 (gmt 0)

Junior Member

5+ Year Member

joined:Oct 19, 2008
posts: 67
votes: 0


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 ?


8:51 pm on Jan 11, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
votes: 0

In frame 1 of the main movie,

var fadeIncrement:Number=25;
var fadeSpeed:Number=0.5;


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());


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.


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members