What I am trying to do is basicly a button, where I can exchange the color of the button and the displayed icon (square, question mark, arrow etc.) via script separately.
Currently I have two containers. One is a MovieClip container for the icons, where I have a different icon in each frame and another MovieClip container for the button backgrounds, containing the same button with different colors in each frame. The icon container is the same for all frames of the button container.
Its instance has a name. In the script layer there is just a stop(); in every frame.
Now the problem is that due to background and icon both being a button symbol (they need to be in order for them to have the 'down' and 'over' states), that the build-in click events are handled separately, meaning, that when the icon is clicked, only the icon's state is changed to 'down' and if the button is clicked, only the button's state is changed to 'down'.
The way I try to handle the problem is that I do
mc_buttonIcon.mouseEnabled = false;
in the button container's class. But somehow it doesn't work. The icon is still clickable. Now if I add
this.mouseChildren = false;
to the button container's class, the states of both, the icon's and the button's states don't change on click.
So here is my question: Is there an elegant way to do a flexible button the color and icon of which can be changed via script without having to have every color with every icon resulting in exponential buttons?
I'd be thankful for any suggestions. Thank you.