[sorry for the cross post, wrong forum the first time…]
This code works fine with 3 buttons. But what to do if I have more than 3 buttons, let’s say 5 of 'em?
// code begins
_root.picnumber=0;
this.btn1.onRelease = function () {
if (_root.picnumber == 2) {
pic2.gotoAndPlay (12);
} else if (_root.picnumber == 3) {
pic3.gotoAndPlay (12);
}
_root.picnumber = 1;
pic1.gotoAndPlay (2);
}
this.btn2.onRelease = function () {
if (_root.picnumber == 1) {
pic1.gotoAndPlay (12);
} else if (_root.picnumber == 3) {
pic3.gotoAndPlay (12);
}
_root.picnumber = 2;
pic2.gotoAndPlay (2);
}
this.btn3.onRelease = function () {
if (_root.picnumber == 2) {
pic2.gotoAndPlay (12);
} else if (_root.picnumber == 1) {
pic1.gotoAndPlay (12);
}
_root.picnumber = 3;
pic3.gotoAndPlay (2);
}