on(release) {
_root.hue = 0x000000;
colorselected = new Color (_root.selected) ;
colorselected.setRGB(_root.hue) ;
}
colorselected = new Color (_root.selected) tells Flash that you want to define a new color function; setRGB wont work without it. The formula is colorname = new Color (_root.instancename), where colorname can be anything that you want (as long as it isnt an existing ActionsScript) and _root.instancename is the name of the instance on stage that you want to be affected by the fill color change. Its basically saying take this new color function, called colorselected, and apply it to instance selected on my stage when I use it in tandem with setRGB.
colorselected.setRGB(_root.hue) then takes the new color, pairs it with the setRGB function, and defines the new fill color. The standard formula uses a hex value, such as colorselected.setRGB (0x000000), but for this case were just going to stick to the variable. Weve told Flash to take the hex value assigned to the variable _root.hue and apply it to the fill of the instance named in colorselected. Now, when I click on the small black square, the larger square turns black and I now have black assigned as my active color through the _root.hue variable.


