Hello all,
I have the following mxml (Omitted some parts for brevity purpose):
<fx:Script>
[Bindable]
private var _dataSet:IDataSet;
public function set dataSet(value:IDataSet)
{
_dataSet = value;
}
private function getColorItem(itemName:*):String
{
if (itemName == "Research") return "#31e5fc";
...
else {
trace("Unknown item : " + itemName);
return #ffffff;
}
}
</fx:Script>
<spark:RichText color="{this.getColorItem(this._dataSet.name)}" ... />
Does anyone knows why the color is not being applied? If I change the binding to the method, for a constant String (i.e. #31e5fc), it works allright?
I need the color to change according to the data received by this component. Any help on where I am doing a mistake is much appreciated.