Displaying icons in a Flex List control

The following example demonstrates how to use embedded images in a List control so that each item in the list displays a little icon based on a certain property in the data provider. You’ll also notice that we set the textIndent style to give the label a bit more padding from the icon. Finally, we create three non-interactive Button controls beneath the list as a sort of “legend” for the icons.

You can also add icons to a List control using the iconFunction property, as seen in the following example. Note that the list’s data provider doesn’t contain a column with the name of the specific icon to use, the icon is being determined by a user-defined function which calculates the icon from the “data” property in data provider.

I believe the skin property was added in Flex 3. See the documentation for the Flex 2.0.1 Button control on LiveDocs for more information.

I created all these samples using the Flex 3 beta and apparently didn’t test in earlier versions (as I’m sure you noticed by now). ;)

I’d imagine you could just set each of the skin styles individually to do the same thing. In that case, I’m sure it would be easier to set the styles in an <mx:Style /&gt block on the Button class, or create a new custom style and use the styleName property.

Figured out the answer to my question. You dont need to extend ListItemRenderer. The default one is good enough.
The currentTarget property of the ListEvent.Click (Not ListEvent.ItemClick) will tell you whether you clicked on the icon (if it exists) or the textfield.

i’m new to RIA, Flex.
Currently i’m using Flex 3.
I have some difficulty in my work.
I want to add icon to Advanced Datagrid control.
I just don’t know how to add it. (I found this sample which added icons to List)
but in ADG, it has not such icon or iconFunction.

Any ideas about how I would have a different itemrenderer for only the first item in the list and the rest of the items follow a 2nd itemrenderer? Right now I only found a way to set the itemrender to the whole List.

does the list_iconFunc have to return a class? I would like to have a function that draws and returns a sprite. I have tried to convert a sprite to a class – but cant find how to do that, and it seems a little ineffecient to do that.

i’m new to RIA, Flex.
Currently i’m using Flex 3.
I have some difficulty in my work.
i have three lists and a button.
depending up on the selected items in first two list and after clicking the button i have to disply the items in third list.can any any one help me
thanks in advance