Removing the theme color from the Flex TileList

There have been a number of occasions when the designs for a UI implements some kind of grid layout to display its items. This is fairly simple to implement in flex by utilising the Flex TileList component. However more often than not the List's item renderers are required to look after their own states. In this case the TileLists Indicators are no longer required.

I have found the easiest way to remove the TileLists indicators is to set the ThemeColor to the background color of whatever the List is being displayed on. But what happens if the background contains an image or has a transparency value?

To do this you need to override the TileLists drawSelectionIndicator and drawHighlightIndicator methods.

override protected function drawSelectionIndicator(
indicator:Sprite, x:Number, y:Number,
width:Number, height:Number, color:uint,
itemRenderer:IListItemRenderer):void
{
/* we don't need to do anything in here*/
}
override protected function drawHighlightIndicator(
indicator:Sprite, x:Number, y:Number,
width:Number, height:Number, color:uint,
itemRenderer:IListItemRenderer):void
{
/* we don't need to do anything in here*/
}

Notice that the body to the above methods are empty. This is because we don't want the indicators to draw anything behind the renderers when the state changes.

Now just don't forget to cater for this inside your TileList's item renderer else the user will get confused as to which item is selected and which item their mouse is over. We wouldn't want that would we :)

Comments
TiTerm's Gravatar for drawHighlightIndicator, it s may be easier to set the useRollOver style to false
# Posted By TiTerm | 8/6/08 7:51 AM
Ben's Gravatar Hi TiTerm,

The issue I have is for the selected item color. It will still use the theme background color even though useRollOver is set to false.
# Posted By Ben | 8/6/08 6:39 PM
Lany's Gravatar At http://rapidpedia.com/ there is a nice teaching application for the issues like this. I was of goog avail for me and considerably helped me with my work.
# Posted By Lany | 2/6/09 3:13 AM
Fabio's Gravatar Thanx for tip! Useful
# Posted By Fabio | 3/6/09 12:49 PM
Ben's Gravatar Hey Fabio,

No problem glad you found it useful
# Posted By Ben | 3/9/09 3:29 AM
timberland shoe company's Gravatar We are traveling by train. Out timberland hiking boots windows, we drink in the passing scene of cars on nearby highways, of children timberland shoe company waving at a crossing, of cattle grazing on a distant timberland boots hillside, of smoke pouring from a power plant, of row upon row of corn and wheat, of flatlands and timberland wheat shoes valleys, of mountains and rolling classic 3 eye timberland boat hillsides, of city skylines and village halls. But uppermost in our black timberland boots minds is the final destination.
# Posted By timberland shoe company | 8/28/10 1:12 AM
# Posted By coach outlet | 9/8/10 4:45 AM
BlogCFC was created by Raymond Camden. This blog is running version 5.9.002. Contact Blog Owner