# Fade out current, load in new on Release?

**URL:** <https://forum.kirupa.com/t/fade-out-current-load-in-new-on-release/204696>\
**Category:** Uncategorized\
**Created:** [October 22, 2006, 5:01pm UTC](https://forum.kirupa.com/t/fade-out-current-load-in-new-on-release/204696 "2006-10-22T17:01:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hkl](https://avatars.discourse-cdn.com/v4/letter/h/a8b319/32.png) [@hkl](https://forum.kirupa.com/u/hkl)\
**Post date:** [October 22, 2006, 5:01pm UTC](https://forum.kirupa.com/t/fade-out-current-load-in-new-on-release/204696/1 "2006-10-22T17:01:11Z")

</div>

Hello Kirupians,

I hope someone could assist me with this.

Im looking to have background1(an mc). If a button is pressed then the current background fades while background2 fades in. There would be about 5 buttons. So I couldnt just use something like

```auto
btnOne.onPress = function() {
     background1._alpha = 100;
}

btnTwo.onPress = function() {
   background1._alpha = 0;
   background2._alpha = 100;
}

```

because what happens if i press btnThree, then btOne, then btnFour then btnTwo.

I think i have the idea right by storing the current bg mc into a var and referencing that.

something like

```auto
background1._alpha = 100;
currentBg = background1;

btnTwo.onPress = function() {
     currentBg._alpha = 0;
     background2._alpha = 100;
     currentBg = background2;
}

btnThree.onPress = function() {
     currentBg._alpha = 0;
     background3._alpha = 100;
     currentBg = background3;
}

```

and so on. Im not really sure.

p.s sorry for syntax and functions usage. just trying to get my point across.,
