Hey guys,
I am trying to cut down on coding by using the “for loop” function, but I do not know if this is possible in my situation. I am not duplicating MC buttons, rather the code on frame 1 which assigns functions to hand placed buttons.
I have a sub menu which currently has 5 buttons, but may go up to 20 or 30. This will need too much hand coding, so in comes the “for loop” deal, but am I doing this right?
for (myCounter = 0; myCounter < 5; myCounter++) {
btnnumber = myCounter+1;
workbtnnumber = "subabout.about" + btnnumber;
trace(workbtnnumber)
//script to be repeated 5 times to create behaviours for 5 buttons labelled "about1, about2, etc in MC called "subabout"
workbtnnumber.onRollOver = function() {
fadeIn = false;
fade(subabout, 50, subwork, subplay);
};
workbtnnumber.onRollOut = function() {
fadeIn = true;
fade(subabout);
};
//End Repeated Script - If this works, you should be able to rollover the sub options of the first box without them dissapearing!
};
Any help would be greatly appreciated as I have tried myself for some time before asking.
mecha