Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to gradually make an MC alpha increase slowly? 1

Status
Not open for further replies.

ColonelBlue

Technical User
Jun 24, 2004
110
US
I have a movieclip start out with an alpha 0f 0.
Later when an event is toggled I have it run:

_root.Logo_main.bannertext._alpha=100;

BUT the alpha goes to 100 instantly.
I would like for the alpha to increase gradually, as if fading in.

Thanks in advance.
 
onClipEvent(enterFrame){
if(this._alpha < 100){
this._alpha +=2;
} else {
this._alpha = 100;
}
}

If you want it to only fade in at some later point, you can further condition the fade in to a variable set at one point, on a button or elsewhere...

on(release){
_level0.fadeIn = true;
// possible other code...
}

And modify the fade in script in this manner...

onClipEvent(enterFrame){
if(_level0.fadeIn){
if(this._alpha < 100){
this._alpha +=2;
} else {
this._alpha = 100;
}
}
}

You can also change the 2 figure by a higher number, if you want a faster fade.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top