someoneAnyone

someoneAnyone
- Name: [not set]
- Favorite Languages: [not set]
- Website: [not set]
- Location: [not set]
- About Me: [not set]
-
Flex Tutorial - Change the List Selection Indicator
08/03/2010 - 15:06
I've been playing with your example and I'm finding that when I extend the list with your code that I get some alignment and width issues when a scroll bar is present with my newly overridden drawSelectionIndicator. I don't see this issue when I use the standard list component. Have you noticed this at all?
<test:ControlableListHighlight dataProvider="{arrayCollection}" creationComplete="genListItems(event)" width="100%" rollOverColor="0x438ece" height="100%"/>package test
{
import flash.display.GradientType;
import flash.display.Graphics;
import flash.display.Sprite;
import flash.geom.Matrix;
import mx.controls.List;
import mx.controls.listClasses.IListItemRenderer;
public class ControlableListHighlight extends List
{
override protected function drawSelectionIndicator(indicator:Sprite, x:Number, y:Number, width:Number, height:Number, color:uint, itemRenderer:IListItemRenderer):void
{
var selectionColorArray:Array=[0x65b6fc, 0xb3e1ff];
var selectionGradientType:String=GradientType.LINEAR;
var selectionGradientAlphas:Array=[1, .5];
var selectionRatioArray:Array=[0, 255];
var selectionMatrix:Matrix=null;
var selectionCornerRadiusWidth:int=0;
var selectionCornerRadiusHeight:int=0;
var g:Graphics=indicator.graphics;
g.clear();
g.beginGradientFill(selectionGradientType, selectionColorArray, selectionGradientAlphas, selectionRatioArray, selectionMatrix);
//g.drawRect(0, 0, width, height);
g.drawRoundRect(0,0,width,height,selectionCornerRadiusWidth,selectionCornerRadiusHeight);
g.endFill();
indicator.x=x;
indicator.y=y;
}
}
}
Recent Comments