package skins { import flash.display.GradientType; import flash.geom.Matrix; import mx.skins.ProgrammaticSkin; import mx.utils.ColorUtil; public class ComboSkin extends ProgrammaticSkin { private var backgroundColor: uint = 0xFFFFFF; private var backgroundColorAlt: uint = 0xFFFFFF; private var borderColor: uint = 0; private var borderThickness: uint = 1; private var borderAlpha: Number = 1; private var backgroundAlpha: Number = 1; private var arrowColor: uint; private var arrowZoneWidth: Number = 18; override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { graphics.clear(); borderColor = 0xCCCCCC;//getStyle('borderColor'); backgroundColor = ColorUtil.adjustBrightness(getStyle('fillColors')[0], 30); arrowColor = getStyle('arrColor'); var radius: Number = 3; graphics.lineStyle(1, borderColor); drawRoundRect(0, 0, unscaledWidth - arrowZoneWidth - 4, unscaledHeight, radius, backgroundColor, 1); switch (name) { case "upSkin": break; case "overSkin": backgroundColor = ColorUtil.adjustBrightness(getStyle('fillColors')[0], 10); arrowColor = ColorUtil.adjustBrightness(arrowColor, -150); break; case "downSkin": break; case "disabledSkin": alpha = 0.3; break; } var backgroundColorAlt: uint = ColorUtil.adjustBrightness(backgroundColor, 120); var mX: Number = unscaledWidth - arrowZoneWidth; var mY: Number = 2; var w: Number = arrowZoneWidth - 2; var h: Number = unscaledHeight - mY*2; graphics.lineStyle(0, 0, 0); drawRoundRect( mX - 1, mY - 1, w + 4, h + 4, 8, 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(w, h, Math.PI/2, mX, mY); graphics.lineStyle(1, borderColor, borderAlpha); drawRoundRect(mX, mY, w, h, radius, cols, alphas, matrix, GradientType.LINEAR, ratios); var cX: Number = mX + w/2; var cY: Number = unscaledHeight/2; with (graphics) { beginFill(backgroundColor); lineStyle(1, backgroundColor, 1); moveTo(cX + 4, cY - 3); lineTo(cX - 3, cY - 3); lineTo(cX, cY + 3); lineStyle(1, backgroundColorAlt, 1); lineTo(cX + 4, cY - 3); endFill(); } } } }