package components { import flash.display.Sprite; import mx.controls.List; import mx.controls.listClasses.IListItemRenderer; public class CustomList extends List { public static var skinClass: Object = null; override protected function drawHighlightIndicator( indicator:Sprite, xx:Number, yy:Number, ignoredWidth:Number, h:Number, color:uint, ignoredRenderer:IListItemRenderer):void { var w:int = unscaledWidth - viewMetrics.left - viewMetrics.right; if (null == skinClass) { super.drawHighlightIndicator(indicator, xx, yy, ignoredWidth, h, color, ignoredRenderer); } else { skinClass.drawListItem(indicator.graphics, w, h, 'highlight'); } indicator.x = xx; indicator.y = yy; } override protected function drawSelectionIndicator( indicator:Sprite, xx:Number, yy:Number, ignoredWidth:Number, h:Number, color:uint, ignoredRenderer:IListItemRenderer):void { var w:int = unscaledWidth - viewMetrics.left - viewMetrics.right; if (null == skinClass) { super.drawSelectionIndicator(indicator, xx, yy, ignoredWidth, h, color, ignoredRenderer); } else { skinClass.drawListItem(indicator.graphics, w, h, 'selection'); } indicator.x = xx; indicator.y = yy; } } }