Hello, I thought this should be trivial to implement but I just couldn't find a clean solution...
I have a List with vertical layout and it is selectable. As the list item is pretty simple so I decided to use DefaultListItemRenderer. For selected item, I'd like to change it's label color(or maybe change the icon as well).
Currently I implement this by the following code:
`sc.setItemRendererFactoryWithID( "normal-item", normalItemFac );
sc.setItemRendererFactoryWithID( "sele-item", selectedItemFac );
sc.factoryIDFunction = function( item:Object, index:int ):String
{
if(index != seleInd)
{
return "normal-item";
}else{
return "sele-item";
}
};`
And within the Event.CHANGE listener, I invalidate the List to refresh the display...
My question is that first it does NOT look right for such a simple task so I thought I must have done it in wrong way. Secondly sometimes the list is not validated until I scroll it... Please point the right direction for me! Any comments would be appreciated!
p.s. I also have an unrelated question. Only the label region in list item is selectable. Is it possible to let the full area of item selecteable? (Do I have to add a background skin for the item?)