package skins { import flash.display.GradientType; import flash.geom.Matrix; import mx.controls.scrollClasses.ScrollBar; import mx.skins.Border; import mx.utils.ColorUtil; public class VScroll extends Border { override public function get measuredWidth():Number { return ScrollBar.THICKNESS; } override public function get measuredHeight():Number { return 11; } private var backgroundColor: uint; private var backgroundColorAlt: uint; private var borderColor: uint; private var padding: Number = 2; override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { super.updateDisplayList(unscaledWidth, unscaledHeight); graphics.clear(); unscaledWidth -= 1; borderColor = getStyle('borderColor'); backgroundColor = getStyle('fillColors')[0]; switch (name) { case "thumbDownSkin": backgroundColor = ColorUtil.adjustBrightness(getStyle('fillColors')[0], 60); break; default: break; } backgroundColorAlt = ColorUtil.adjustBrightness(backgroundColor, 120); var matrix: Matrix = new Matrix(); matrix.createGradientBox(unscaledWidth, unscaledHeight, 0, 0, 0); drawRoundRect(padding + 1, 0, unscaledWidth - padding*2 - 1, unscaledHeight, 0, [backgroundColor, backgroundColorAlt, backgroundColor], [1, 1, 1], matrix, GradientType.LINEAR, [40, 80, 200]); } } }