I'm working on a widget for the Viewer for Flex. There are some elements that I disable based on certain conditions, such as the layer that is loaded or a variable that is selected. For example, I have a CheckBox that when clicked will convert a variable to a density (e.g., pop per square mile), and I disable it (enabled = false) when a rate variable is displayed.
When I disable the CheckBox, I also convert the Spark Label next to it to italics and change the color to a medium gray to indicate that it is inactive.
My problem arises when I want to return the Label text to the normal style and the default color (see line 17 below). In the development environment, the widget is gray and the text is white. I have hard-coded this color change, but when I move this widget over to another application that uses a different color scheme with black text, then the Label suddenly stands out wrong because I'm coloring it white.
What I really want to do is to read the text color that is specified in the main config.xml file for the viewer application and assign that color in line 17.
How do I read that from inside a widget?
protected function classificationFieldsDDL_changeHandler(event:IndexChangeEvent):void
{
classificationField = DropDownList(event.currentTarget).selectedItem.data;
classificationFieldAlias = DropDownList(event.currentTarget).selectedItem.label;
classificationFieldNormalize = DropDownList(event.currentTarget).selectedItem.norm;
if (classificationFieldNormalize == '0')
{
normalizationChkBx.selected = false;
normalizationChkBx.enabled = false;
normalizationLabel.setStyle('fontStyle', 'italic');
normalizationLabel.setStyle('color', '0xa0a0a0');
}
else
{
normalizationChkBx.enabled = true;
normalizationLabel.setStyle('fontStyle', 'normal');
normalizationLabel.setStyle('color', '0xffffff');
}
generateRenderer();
}