# Fadin in / out

**URL:** <https://forum.kirupa.com/t/fadin-in-out/231563>\
**Category:** flash\
**Created:** [July 5, 2007, 7:46pm UTC](https://forum.kirupa.com/t/fadin-in-out/231563 "2007-07-05T19:46:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Theofiel](https://avatars.discourse-cdn.com/v4/letter/t/9f8e36/32.png) [@Theofiel](https://forum.kirupa.com/u/Theofiel)\
**Post date:** [July 5, 2007, 7:46pm UTC](https://forum.kirupa.com/t/fadin-in-out/231563/1 "2007-07-05T19:46:28Z")

</div>

I’ve been searching the forum whole night and came up with some posts but I just can get it to work,please some help is needed.

I want background picture1 fade out and picture 2 fade in on menu click, so here is what I came up with…please don’t laugh , I have tried it:hangover:

1ste frame:

```auto

myInterval=setInterval(fadeIn, 1000/30)

function fadeIn (_mcname1,_mcname2){
    _root.bg._mcname1._alpha+=5
    _root.bg._mcname2._alpha-=5
    if(_root.bg._mcname1._alpha>=100){
        _root.bg._mcname1._alpha=100
        _root.bg._mcname2_alpha=0
        clearInterval(myInterval)
    }
}

```

menu button:

```auto

if (menu[j][0] == menu[2][0])
        {
           _root.fadeIn(photo1,photo2);
           closeAbout();
        }
        else if (menu[j][0] == menu[3][0])
        {
          _root.fadeIn(photo2,photo3);            
           closecontacts();
           
        } // end else if

```
