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 colBackground: uint = 0xFFFFFF; private var colListBackground: uint = 0xFFFFFF; private var colBorder: uint = 0; private var borderThickness: uint = 1; private var borderAlpha: Number = 1; private var backgroundAlpha: Number = 1; private var arrowZoneWidth: Number = 14; private var arrColor: uint = 0xFFFFFF; private var radius: Number = 5; override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { graphics.clear(); colBorder= getStyle('borderColor'); arrColor = getStyle('arrColor'); colBackground = getStyle('fillColors')[0]; colListBackground = getStyle('fillColors')[0]; var colAlt: uint; colAlt = ColorUtil.adjustBrightness(colBackground, 90); switch (name) { case "upSkin": break; case "overSkin": colBackground = ColorUtil.adjustBrightness(getStyle('fillColors')[0], 60); colAlt = ColorUtil.adjustBrightness(colBackground, 90); break; case "downSkin": colAlt = colBackground; break; case "disabledSkin": alpha = 0.3; break; } graphics.lineStyle(2, colBorder, borderAlpha); drawRoundRect(0, 0, unscaledWidth, unscaledHeight, 0, colListBackground, backgroundAlpha); var matrix:Matrix = new Matrix(); matrix.createGradientBox(unscaledWidth, unscaledHeight, Math.PI/2, unscaledWidth - arrowZoneWidth); graphics.lineStyle(1, colBorder, borderAlpha); drawRoundRect( unscaledWidth - arrowZoneWidth, 0, arrowZoneWidth, unscaledHeight, 0, [colBackground, colAlt, colBackground], [1,1,1], matrix, GradientType.LINEAR, [0, 60, 190]); var cX: Number = unscaledWidth - arrowZoneWidth/2 + 1; var cY: Number = unscaledHeight/2; with (graphics) { lineStyle(2, arrColor, 1); moveTo(cX - 3, cY - 1); lineTo(cX, cY + 2); lineTo(cX + 3, cY - 1); } } } }