package skins.Aqua { import flash.display.GradientType; import flash.display.InterpolationMethod; import flash.display.SpreadMethod; import flash.geom.Matrix; import mx.controls.scrollClasses.ScrollBar; import mx.skins.Border; public class VScrollArrowDown extends Border { override public function get measuredWidth():Number { return ScrollBar.THICKNESS; } override public function get measuredHeight():Number { return ScrollBar.THICKNESS; } override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { super.updateDisplayList(unscaledWidth, unscaledHeight); graphics.clear(); var cols: Array = getStyle('fillColors'); var colTop: uint = cols[1]; var colMid: uint = cols[0]; var colBot: uint = 0xEEEEEE; var ratTop: uint = 0x00; var ratMid: uint = 0x55; var ratBot: uint = 0xFF; graphics.lineStyle(1, getStyle('borderColor'), 1); var isUp: Boolean = (name.indexOf('up') != -1); switch (name) { case "upArrowUpSkin": case "downArrowUpSkin": case "upArrowOverSkin": case "downArrowOverSkin": break; case "upArrowDownSkin": case "downArrowDownSkin": if (getStyle('downFillColors')) { var colsDown: Array = getStyle('downFillColors'); colTop = colsDown[1]; colMid = colsDown[0]; colBot = 0xEEEEEE; } break; default: break; } var colors:Array = [ colTop, colMid, colBot]; var alphas:Array = [1, 1, 1]; var ratios:Array = [ratTop, ratMid, ratBot]; var matrix:Matrix = new Matrix(); matrix.createGradientBox(unscaledWidth, unscaledHeight, 0*Math.PI/180, 0, 0); graphics.beginGradientFill(GradientType.LINEAR, colors, alphas, ratios, matrix); var radius: uint = 0; graphics.drawRoundRect(1, 0, unscaledWidth - 2, unscaledHeight, radius, radius); graphics.endFill(); var typeGlare:String = GradientType.RADIAL; var colorsGlare:Array = [0xFFFFFF, 0xFFFFFF, 0xFFFFFF]; var alphasGlare:Array = [0.4, 0.4, 0]; var ratiosGlare:Array = [0, 220, 255]; var spreadMethodGlare:String = SpreadMethod.PAD; var interpGlare:String = InterpolationMethod.LINEAR_RGB; var focalPtRatioGlare:Number = 0; var matrixGlare:Matrix = new Matrix(); var boxHeightGlare:Number = unscaledHeight*1.3; var boxWidthGlare:Number = unscaledWidth; var boxRotationGlare:Number = Math.PI/2; // 90˚ var txGlare:Number = -boxWidthGlare*0.5; var tyGlare:Number = -0.15*unscaledHeight; matrixGlare.createGradientBox(boxWidthGlare, boxHeightGlare, boxRotationGlare, txGlare, tyGlare); graphics.lineStyle(0, 0, 0); graphics.beginGradientFill(typeGlare, colorsGlare, alphasGlare, ratiosGlare, matrixGlare, spreadMethodGlare, interpGlare, focalPtRatioGlare); graphics.drawRoundRect(1, 0, unscaledWidth-2, unscaledHeight-1, radius, radius); graphics.endFill(); with (graphics) { beginFill(0, 1); if (isUp) { moveTo(unscaledWidth/2 - 2, unscaledHeight/2+2); lineTo(unscaledWidth/2, unscaledHeight/2-2); lineTo(unscaledWidth/2 + 2, unscaledHeight/2+2); lineTo(unscaledWidth/2 - 2, unscaledHeight/2+2); } else { moveTo(unscaledWidth/2 - 2, unscaledHeight/2-2); lineTo(unscaledWidth/2, unscaledHeight/2+2); lineTo(unscaledWidth/2 + 2, unscaledHeight/2-2); lineTo(unscaledWidth/2 - 2, unscaledHeight/2-2); } endFill(); } } } }