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 backgroundColor: uint; private var borderColor: uint; private var colArrow: uint; override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { super.updateDisplayList(unscaledWidth, unscaledHeight); graphics.clear(); borderColor = getStyle('borderColor'); backgroundColor = getStyle('fillColors')[0]; colArrow = getStyle('arrColor'); drawRoundRect(0, 0, unscaledWidth, unscaledHeight, 0, 0, 0); var isUp: Boolean = (name.indexOf('up') != -1); switch (name) { case "upArrowUpSkin": case "downArrowUpSkin": break; case "upArrowDownSkin": case "downArrowDownSkin": backgroundColor = ColorUtil.adjustBrightness(backgroundColor, 60); case "upArrowOverSkin": case "downArrowOverSkin": graphics.beginFill(backgroundColor, 0.7); graphics.drawRoundRect( 0, 0, unscaledWidth, unscaledHeight, 3); graphics.endFill() graphics.lineStyle(1, borderColor, 1); var matrix: Matrix = new Matrix(); matrix.createGradientBox(unscaledWidth, unscaledHeight, 0, 0, 0); drawRoundRect(0, 0, unscaledWidth, unscaledHeight, 3, [0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF], [0.4, 0.4, 0.2, 0.2], matrix, GradientType.LINEAR, [0, 120, 150, 255]); break; default: break; } with (graphics) { lineStyle(0, 0, 0); beginFill(colArrow); var cX: int = unscaledWidth/2; var cY: int = unscaledHeight/2; if (isUp) { moveTo(cX, cY - 2); lineTo(cX + 4, cY + 2); lineTo(cX - 4, cY + 2); lineTo(cX, cY - 2); } else { moveTo(cX + 4, cY - 2); lineTo(cX - 4, cY - 2); lineTo(cX, cY + 2); lineTo(cX + 4, cY - 2); } } } } }