package skins { import flash.display.GradientType; import flash.display.InterpolationMethod; import flash.display.SpreadMethod; 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]; colArrow = getStyle('arrColor'); 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 typeGlare:String = GradientType.RADIAL; var colors:Array = [ ColorUtil.adjustBrightness(colBackground, 150), colBackground]; var spreadMethodGlare:String = SpreadMethod.PAD; var interpGlare:String = InterpolationMethod.LINEAR_RGB; var focalPtRatioGlare:Number = 0; var matrixGlare:Matrix = new Matrix(); var boxWidthGlare:Number = unscaledHeight; var boxHeightGlare:Number = unscaledHeight; var boxRotationGlare:Number = Math.PI/2; // 90˚ var txGlare:Number = - unscaledHeight/2 + 4; var tyGlare:Number = - unscaledHeight/2 + 5; matrixGlare.createGradientBox(boxWidthGlare, boxHeightGlare, boxRotationGlare, txGlare, tyGlare); graphics.lineStyle(1, colBorder, 1); graphics.beginGradientFill(typeGlare, colors, [1, 1], [0, 0x90], matrixGlare, spreadMethodGlare, interpGlare, focalPtRatioGlare); graphics.drawRoundRect( 0, 0, unscaledWidth, unscaledHeight, 5, 5); graphics.endFill(); with (graphics) { var cX: int = unscaledWidth/2; var cY: int; lineStyle(2, colArrow, 1); if (isUp) { cY = unscaledHeight/2 - 2; moveTo(cX - 3, cY + 3); lineTo(cX, cY); lineTo(cX + 3, cY + 3); } else { cY = unscaledHeight/2 + 2; moveTo(cX - 3, cY - 3); lineTo(cX, cY); lineTo(cX + 3, cY - 3); } } } } }