I'm using a flash menu builded with AS2. It does what it's supposed to: if you click a button in the menu, this button goes in a selected status, most important, this button fades out only when another button is released. you can see the demo here:
http://activeden.net/item/buttons-section-selected/6100
It works with this code:**
//SET STAGE
Stage.scaleMode = "noScale"
//SET BUTTONS TEXT (Here you can change the buttons name)
b1.MC_btnTxt.TXT.text = "Button 1";
b2.MC_btnTxt.TXT.text = "Button 2";
b3.MC_btnTxt.TXT.text = "Button 3";
b4.MC_btnTxt.TXT.text = "Button 4";
b5.MC_btnTxt.TXT.text = "Button 5";
/*CREATE THE BUTTONS ARRAY(if you wanna add or delete
buttons you have to ad or delete the istance button name from the list*/
var myArray = [b1,b2,b3,b4,b5];
//CREATE FUNCTIONS FOR THE BUTTONS ANIMATION
function overBtn (){
for (j=0; j<myArray.length; j++) {
myArray[j].onRollOver = function(){
this.gotoAndPlay(2);
}
myArray[j].onRollOut = function(){
this.gotoAndPlay("fadeOut");
}
}
}
function releaseStatus() {
for (a=0; a<myArray.length; a++) {
myArray[a].enabled = false;
}
deselection();
}
function deselection() {
for (b=0; b<myArray.length; b++) {
if (b<>selectedBtn) {
myArray[b].enabled = true;
if(myArray[b]._currentframe==32)
myArray[b].gotoAndPlay("selectionFadeOut");
}
}
}
// SET BUTTONS
b1.onRelease = function() {
sectionTXT.text = "Section 1"
selectedBtn = 0;
releaseStatus();
this.gotoAndPlay("selectionFadeIn");
}
b2.onRelease = function() {
sectionTXT.text = "Section 2"
selectedBtn = 1;
releaseStatus();
this.gotoAndPlay("selectionFadeIn");
}
b3.onRelease = function() {
sectionTXT.text = "Section 3"
selectedBtn = 2;
releaseStatus();
this.gotoAndPlay("selectionFadeIn");
}
b4.onRelease = function() {
sectionTXT.text = "Section 4"
selectedBtn = 3;
releaseStatus();
this.gotoAndPlay("selectionFadeIn");
}
b5.onRelease = function() {
sectionTXT.text = "Section 5"
selectedBtn = 4;
releaseStatus();
this.gotoAndPlay("selectionFadeIn");
}
//INIT INTERFACE
overBtn();
The problem is that, if you want to add a button inside the buttons (b1, b2, b3...) the inner buttons doesn´t work. For instance: the code below doesn´t works for a button inside one of the main buttons (b5).
b5.ex .onRelease = function ()
{
this.gotoAndStop("selectionInnerButton");
}
;
My question is: What should I change in the code in order to make the inner buttons work properly?
Thanks!