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
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
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.,