Hey!
I have a mc (menu) with 9 btns:
- bnt01
- bnt02
- bnt03
- bnt04
- bnt05
- bnt06
- bnt07
- bnt08
- bnt09
All the buttons are inicially #999999 (dark gray)
On roll over, each btn displays the red color # FF0000
On roll out, they go back to their original color #999999 (dark gray)
On release, the clicked btn displays the red color # FF0000 and when another btn is clicked, this btn displays the red color # FF0000 and the color of the other 8 btns are set to #999999 (dark gray).
My code for this is working fine but I`ll have to repeat it for all the buttons.
Here it is:
// onRelease
_root.A.btn01.onRelease = function () {
// visited color
visitedcolor = new Color(this);
visitedcolor.setRGB(0xFF0000);
visitedcolor = new Color(_root.A.btn02);
visitedcolor.setRGB(0x999999);
visitedcolor = new Color(_root.A.btn03);
visitedcolor.setRGB(0x999999);
visitedcolor = new Color(_root.A.btn04);
visitedcolor.setRGB(0x999999);
visitedcolor = new Color(_root.A.btn05);
visitedcolor.setRGB(0x999999);
visitedcolor = new Color(_root.A.btn06);
visitedcolor.setRGB(0x999999);
visitedcolor = new Color(_root.A.btn07);
visitedcolor.setRGB(0x999999);
visitedcolor = new Color(_root.A.btn08);
visitedcolor.setRGB(0x999999);
visitedcolor = new Color(_root.A.btn09);
visitedcolor.setRGB(0x999999);
}
For each btn I would have to change set.RGB
Can some help me creating a function so that I would have to repeat this lines for each btn???
Thanks