I have 180 buttons in one Flash file and for all buttons I need a roll over and a click event, so the code I`m using is:
button1.onRollOver = function() { //on roll over change button color as white
var color = new Color(button1);
color.setRGB("0xFFFFFF");
};
button1.onRollOut = function() { //on roll out reset button color to it`s default
resetColorFunction();
};
button1.onPress = function() { //on click/press runs javascript function in page
getURL("javascript:ButtonPress('button1');");
};
The problem is that I have 180 buttons, so I`m copying this code to each button, button1, button2, button3, button4 …etc until button180.
Is there any way to loop through all buttons with one simple code, function.
Thank you
You can use eval in Actionscript 2 to get all your buttons tagged with minimal effort.
And there you have it all nice and fast.