Fadin in / out

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:


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:


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