package skins { import flash.display.GradientType; import flash.geom.Matrix; import mx.skins.Border; import mx.utils.ColorUtil; public class VScrollArrow extends Border { private var thickness: Number = 15; override public function get measuredWidth():Number { return thickness;//ScrollBar.THICKNESS; } override public function get measuredHeight():Number { return thickness;//ScrollBar.THICKNESS; } private var colBackground: uint; private var colBorder: uint; private var colArrow: uint; override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { super.updateDisplayList(unscaledWidth, unscaledHeight); graphics.clear(); colBorder= getStyle('borderColor'); colBackground = getStyle('fillColors')[0]; var isUp: Boolean = (name.indexOf('up') != -1); switch (name) { case "upArrowUpSkin": case "downArrowUpSkin": break; case "upArrowOverSkin": case "downArrowOverSkin": break; case "upArrowDownSkin": case "downArrowDownSkin": colBackground = ColorUtil.adjustBrightness(getStyle('fillColors')[0], 60); break; default: break; } var cX: Number = unscaledWidth / 2; var cY: Number = unscaledHeight / 2; graphics.lineStyle(1, colBorder, 1); var matrix: Matrix = new Matrix(); matrix.createGradientBox(unscaledWidth, unscaledHeight, 0, 0, 0); var colAlt: uint = ColorUtil.adjustBrightness(colBackground, 90); drawRoundRect( 0, 0, unscaledWidth, unscaledHeight, 0, [colBackground, colAlt, colBackground], [1, 1, 1], matrix, GradientType.LINEAR, [0, 60, 190]); colArrow = colAlt; with (graphics) { beginFill(colArrow, 1); if (isUp) { cY -= 4; lineStyle(1, colBorder, 1); moveTo(cX - 5, cY + 7); lineTo(cX, cY); lineTo(cX + 5, cY + 7); lineTo(cX - 5, cY + 7); } else { cY += 4; lineStyle(1, colBorder, 1); moveTo(cX - 5, cY - 7); lineTo(cX, cY); lineTo(cX + 5, cY - 7); lineTo(cX - 5, cY - 7); } endFill(); } } } }