package skins { import flash.display.GradientType; import flash.geom.Matrix; import mx.skins.Border; import mx.utils.ColorUtil; public class TabBar extends Border { private var backgroundColor: uint = 0xFFFFFF; private var backgroundColorAlt: uint = 0xFFFFFF; private var borderColor: uint = 0; private var borderThickness: Number = 1; private var borderAlpha: Number = 0.8; private var backgroundAlpha: Number = 1; override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { unscaledWidth -= 3; graphics.clear(); borderColor = 0xCCCCCC;//getStyle('borderColor'); backgroundColor = ColorUtil.adjustBrightness(getStyle('fillColors')[0], 30); backgroundColorAlt = ColorUtil.adjustBrightness(backgroundColor, 120); var h: Number = unscaledHeight - 6; switch (name) { case 'selectedOverSkin': case 'selectedDownSkin': case 'selectedUpSkin': backgroundColor = ColorUtil.adjustBrightness(backgroundColor, -20); h = unscaledHeight - 3; break; case 'overSkin': case 'downSkin': default : break; } switch (name) { case "upSkin": break; case "overSkin": backgroundColor = ColorUtil.adjustBrightness(getStyle('fillColors')[0], 10); break; case "downSkin": break; case "disabledSkin": alpha = 0.3; break; } var mY: Number = unscaledHeight - h - (unscaledHeight - h)/2; var radius: Number = 3; graphics.lineStyle(0, 0, 0); drawRoundRect( -1, mY-1, unscaledWidth + 4, h + 4, 5, ColorUtil.adjustBrightness(backgroundColor, -40), 0.5); var cols: Array = [backgroundColor, backgroundColorAlt, backgroundColor]; var alphas: Array = [1, 1, 1]; var ratios: Array = [10, 90, 200]; var matrix: Matrix = new Matrix(); matrix.createGradientBox(unscaledWidth, h, Math.PI/2, 0, mY); graphics.lineStyle(1, borderColor, borderAlpha); drawRoundRect(0, mY, unscaledWidth, h, radius, cols, alphas, matrix, GradientType.LINEAR, ratios); } } }