# Calling alpha value to start another alpha fade?

**URL:** <https://forum.kirupa.com/t/calling-alpha-value-to-start-another-alpha-fade/73670>\
**Category:** Uncategorized\
**Created:** [December 19, 2004, 5:29am UTC](https://forum.kirupa.com/t/calling-alpha-value-to-start-another-alpha-fade/73670 "2004-12-19T05:29:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhamann](https://avatars.discourse-cdn.com/v4/letter/d/b5ac83/32.png) [@dhamann](https://forum.kirupa.com/u/dhamann)\
**Post date:** [December 19, 2004, 5:29am UTC](https://forum.kirupa.com/t/calling-alpha-value-to-start-another-alpha-fade/73670/1 "2004-12-19T05:29:20Z")

</div>

hey all!

okay so here’s the deal I’m on a mission to make these buttons fade in one after another using a.s

and I’d like all my code to be in one frame [don’t we all though :sure:]

so far i have one fading in using

```auto
this.onEnterFrame = function() {
 if(btn1._alpha < 100) {
 btn1._alpha += 10;
 }
 }

```

now when i said i wanted the buttons to fade in one after another i was kinda fibbing :ne:… what i really want is when btn1 reaches an alpha of 40 i want btn2 to start this same fade in process, then when btn2 reaches 40 i want btn3 to do the same and so on…

[see the effect here](http://www.krafthaus.com/) [you have to enter the site] when you click on work, troops & contact

now i have also been searching for a \*\*easy to understand \*\*tutorial on how to make your own functions [that’s the one where you can write a whole bunch of code stuff then call it later using only a little code, right?

well obviously i want to use this idea so i don’t have to write out [okay lets be real here - copy and paste] the fade in code each time.

that way i figure i can say

if(btn1.\_alpha = 40)  
do the function thingy to btn2

i tried this a.s, it only results in btn2 fading in as asked but btn1 stops fading at 40

```auto

 if(btn1._alpha = 40) {
 this.onEnterFrame = function() {
 if(btn2._alpha < 100) {
 btn2._alpha += 10;
 }
 }
 }

```

any ideas would be the shizzel bo dizzel nizzel!

cheers fo’ all the help so far!

-demian
