package skins { import mx.skins.ProgrammaticSkin; import mx.utils.ColorUtil; public class ComboSkin extends ProgrammaticSkin { private var backgroundColor: uint = 0xFFFFFF; private var listBackgroundColor: uint = 0xFFFFFF; private var borderColor: uint = 0; private var borderThickness: uint = 1; private var borderAlpha: Number = 1; private var backgroundAlpha: Number = 1; private var arrowZoneWidth: Number = 16; private var arrColor: uint = 0xFFFFFF; override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { graphics.clear(); borderColor = getStyle('borderColor'); arrColor = getStyle('arrColor'); backgroundColor = getStyle('fillColors')[0]; listBackgroundColor = ColorUtil.adjustBrightness(getStyle('fillColors')[0], 60); var cols: Array; cols = [0xFFFFFF, borderColor]; var colsArrow: Array = [ColorUtil.adjustBrightness(backgroundColor, 90), ColorUtil.adjustBrightness(backgroundColor, -35)]; with (graphics) { beginFill(listBackgroundColor); lineStyle(borderThickness, cols[0], borderAlpha); moveTo(0, unscaledHeight); lineTo(0, 0); lineTo(unscaledWidth - arrowZoneWidth - 1, 0); lineStyle(borderThickness, cols[1], borderAlpha); lineTo(unscaledWidth - arrowZoneWidth - 1, unscaledHeight); lineTo(0, unscaledHeight); endFill(); switch (name) { case "upSkin": break; case "overSkin": backgroundColor = ColorUtil.adjustBrightness(backgroundColor, 30); break; case "downSkin": cols = cols.reverse(); colsArrow = colsArrow.reverse(); break; case "disabledSkin": alpha = 0.3; break; } beginFill(backgroundColor); lineStyle(borderThickness, cols[0], borderAlpha); moveTo(unscaledWidth - arrowZoneWidth, unscaledHeight); lineTo(unscaledWidth - arrowZoneWidth, 0); lineTo(unscaledWidth, 0); lineStyle(borderThickness, cols[1], borderAlpha); lineTo(unscaledWidth, unscaledHeight); lineTo(unscaledWidth - arrowZoneWidth, unscaledHeight); endFill(); } var cX: Number = unscaledWidth - arrowZoneWidth/2; var cY: Number = unscaledHeight/2; with (graphics) { beginFill(backgroundColor, 1); lineStyle(2, colsArrow[1], 1); moveTo(cX + 5, cY - 6); lineTo(cX, cY + 6); lineStyle(2, colsArrow[0], 1); lineTo(cX - 5, cY - 6); lineTo(cX + 5, cY - 6); endFill(); } } } }