package skins.WB { import flash.display.GradientType; import flash.geom.Matrix; import mx.skins.ProgrammaticSkin; import mx.utils.ColorUtil; public class ButtonSkin extends ProgrammaticSkin { override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { graphics.clear(); var colors:Array = [getStyle('fillColors')[0], ColorUtil.adjustBrightness(getStyle('fillColors')[0], 90)]; var alphas:Array = [1, 1]; var ratios:Array = [0, 0xFF]; var matrix:Matrix = new Matrix(); var angle: int = 90; switch (name) { case "upSkin": if (getStyle('isSelected')) { angle = 0; } else { return; } break; case "overSkin": angle = 270; case "downSkin": break; case "disabledSkin": alpha = 0.7; break; } matrix.createGradientBox(unscaledWidth, unscaledHeight, angle*Math.PI/180, 0, 0); graphics.lineStyle(1, ColorUtil.adjustBrightness(colors[0], 40), 1, true); graphics.beginGradientFill(GradientType.LINEAR, colors, alphas, ratios, matrix); graphics.drawRoundRect(0, 0, unscaledWidth, unscaledHeight, 5, 5); graphics.endFill(); } } }