The design detail:
You want to be able to create item renderers in a list that apply different styles depending on different visual cues or the data itself. For example lets take the TSA’s security approach with colors – the text changes for each level of severity.

The problem:
The problem is in handling the default case where every item renderer style should be the same, in the protected method of makeRowsAndColumns():Point After the itemrenderer instance has been created it’s styleName is set to the listContent container. This is important because no amount of setting through the ClassFactory properties, or setting styles anywhere in the pre-construction phase will save these unique values since it’s reset after it’s created.

The solution:
The one I came up with overrides the actual styleName property itself, where with a bit of checking we can safely ignore only the request coming from this creation area. This looks to make sure the object requesting the new stylename reference isn’t a ListContentBaseHolder or List so long as there is a stylename already set. Remember – properties are populated immediately after construction and before the initialization phase, that means this styleName will have already had something set on it from our ClassFactory in the List/Tree instance when setting our renderer.

override public function set styleName(value:Object):void
if (!super.styleName || (!(value is ListBaseContentHolder) && !(value is ListBase))) super.styleName = value;

Now in the List/Tree instance we can set our styleName:

<mx:Tree itemRenderer=”{myRendererFactory}” />
private function get myRendererFactory():IFactory
var cf:ClassFactory = new ClassFactory(MyRenderer); = {styleName:myStyleName};
return cf;