Hey, now i’ve got a code that looks like this:
b_1.btn_bg.onRelease = function(){
if(_root.currMovie == "case"){
b_1.btn_bg.enabled = false;
b_2.btn_bg.enabled = true;
b_2.initialState();
}
b_2.btn_bg.onRelease = function(){
if(_root.currMovie == "case2"){
b_2.btn_bg.enabled = false;
b_1.btn_bg.enabled = true;
b_1.initialState();
}
What it does is to check if the loaded movie is case1 etc…Then disables the b_1, enables
b_2 button, and runs initialState(); for each button enabled button.
I will have about 5 buttons, and it would be pretty much code to enable every button, and run initialState. How would you optimize it?