views:

266

answers:

1

Indeed they both (skins and itemRenderers) seem to do drawing using the flash.graphics.* package. I have copy pasted code between skins and itemRenderers before, so I really don't understand the difference. I have had more experience implementing itemRenderers than skins, so that might be part of the problem. Thanks, let me know.

+3  A: 

A skin is a graphical element that can be applied to various UIComponents. Containers can have borderSkins and Buttons can have various up/over/down skins. They can be implemented in several ways, including the use of the drawing API ("Programmatic skins") or through embedding assets ("Graphical skins"). Skins are usually pretty lightweight and may only be a Flash DisplayObject rather than a Flex UIComponent, which is more heavyweight but contains much more functionality.

An itemRenderer is typically a UIComponent that a List-based control uses to display an item. You also usually use itemRenderers when using a DataGrid/DataGridColumn. Most components that use itemRenderers recycle them, meaning that they create about as many as are needed to display on the screen, and as the user scrolls through the data the same itemRenderers are repositioned and get new data plugged into them. This is one of the reason why Lists and DataGrid can support large quantities of data and why trying to accomplish similar things with a Repeater leads to apps with terrible performance.

cliff.meyers