package skins.Aqua { import flash.display.GradientType; import flash.geom.Matrix; import mx.skins.ProgrammaticSkin; public class ComboSkin extends ProgrammaticSkin { override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { graphics.clear(); var cols: Array = [0xFFFFFF, 0xFFFFFF]; if (getStyle('fillColors')) { cols = getStyle('fillColors'); } var mainColor : uint = cols[0]; var brighterColor : uint = cols[1]; var colTop: uint = mainColor; var colBot: uint = brighterColor; var ratTop: uint = 0x88; var ratBot: uint = 0xBB; graphics.lineStyle(1, getStyle('borderColor'), 1); switch (name) { case "upSkin": break; case "overSkin": break; case "downSkin": var colsDown: Array = [0xFFFFFF, 0xFFFFFF]; if (getStyle('downFillColors')) { colsDown = getStyle('downFillColors'); } colTop = colsDown[0]; colBot = colsDown[1]; break; case "disabledSkin": alpha = 0.7; break; } var colors:Array = [ colTop, colBot]; var alphas:Array = [1, 1]; var ratios:Array = [ratTop, ratBot]; var matrix:Matrix = new Matrix(); matrix.createGradientBox(unscaledWidth, unscaledHeight, 90*Math.PI/180, 0, 0); graphics.beginGradientFill(GradientType.LINEAR, colors, alphas, ratios, matrix); var radius: uint = 5; graphics.drawRoundRect(0, 0, unscaledWidth, unscaledHeight, radius, radius); graphics.endFill(); graphics.lineStyle(1, 0, 0); graphics.beginFill(0xFFFFFF, 0.45); graphics.drawRoundRect(1, 1, unscaledWidth-1, unscaledHeight/2-1, radius, radius); graphics.endFill(); var arrZoneWidth : uint = 10; var arrZoneColor : uint = 0xFFFFFF; if (getStyle('arrZoneColor')) { arrZoneColor = getStyle('arrZoneColor'); } graphics.beginFill(arrZoneColor, 0.7); graphics.drawRoundRect(unscaledWidth - arrZoneWidth, 1, arrZoneWidth, unscaledHeight-1, radius); graphics.endFill(); graphics.beginFill(0, 1); graphics.moveTo(unscaledWidth - arrZoneWidth/2, 4); graphics.lineTo(unscaledWidth - arrZoneWidth/2 + 2, 8); graphics.lineTo(unscaledWidth - arrZoneWidth/2 - 2, 8); graphics.lineTo(unscaledWidth - arrZoneWidth/2, 4); graphics.moveTo(unscaledWidth - arrZoneWidth/2, unscaledHeight-4); graphics.lineTo(unscaledWidth - arrZoneWidth/2 + 2, unscaledHeight-8); graphics.lineTo(unscaledWidth - arrZoneWidth/2 - 2, unscaledHeight-8); graphics.lineTo(unscaledWidth - arrZoneWidth/2, unscaledHeight-4); graphics.endFill(); } } }