Hello. I am new to flash. I have a question that I have been working on for a long time, but just could not find a good solution. The question is as follow.
Suppose I have a serials of number, for example "1", "2", "3", "4"...
I want to use them as individual buttons. In their original states, the color of all numbers is gray.
when mouse over, down the color change to black.
But after I click a number, "1" for example, it should maintain the black color, until I click a different number, "2" for example. Then "1" changes back to gray color, "2" maintains black color until another number is clicked,
Can I achieve this with action script? If yes, could you please give an example code? Thank you.
There are many ways you could do this. Here's one:
Make each number a movieclip with two child movieclips stored inside it, a black one a gray one. Give the children instance names black and gray. Give the parent the instance name button1 (button2, button3...)
var buttons : Array = [ button1, button2, button3 ];
var selectedButton : MovieClip;
function init() : void
for each( var button : MovieClip in buttons )
prepButton( button );