The following example shows how you can set alternating background colors for tiles in a flex tilelist control by settingAlternatingitemcolors
Style using mxml, CSS or ActionScript.
Full code after the jump.
<? XML version = "1.0" encoding = "UTF-8" ?>
<! -- Http://blog.flexexamples.com/2008/08/10/alternating-tile-background-colors-for-items-in-a-tilelist-control-in-flex/ -->
< MX: Application Name = "Tilelist_alternatingitemcolors_test"
Xmlns: MX = "Http://www.adobe.com/2006/mxml"
Layout = "Vertical"
Verticalalign = "Middle"
Backgroundcolor = "White" >
< MX: arraycollection ID = "Arrcoll" >
< MX: Source >
< MX: Array >
< MX: Object Label = "One" />
< MX: Object Label = "Two" />
< MX: Object Label = "Three" />
< MX: Object Label = "Four" />
< MX: Object Label = "Five" />
< MX: Object Label = "Six" />
< MX: Object Label = "Seven" />
< MX: Object Label = "Eight" />
< MX: Object Label = "Nine" />
< MX: Object Label = "Ten" />
< MX: Object Label = "Eleven" />
< MX: Object Label = "Twelve" />
</ MX: Array >
</ MX: Source >
</ MX: arraycollection >
< MX: tilelist ID = "Tilelist"
Dataprovider = "{Arrcoll }"
Columncount = "4"
Columnwidth = "120"
Rowcount = "3"
Rowheight = "80"
Alternatingitemcolors = "[# Ffffff, # cccccc, #999999]" />
</MX: Application>