package skins.AV { 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 gt: String; var ratios: Array; var adj: int; if (name.toLowerCase().indexOf('over') == -1) { gt = GradientType.RADIAL; ratios = [120, 255]; adj = 30; } else { gt = GradientType.LINEAR; ratios = [0, 255]; adj = 140; } var themeColor: uint = getStyle('fillColors')[0]; var cols: Array = [ themeColor, ColorUtil.adjustBrightness(themeColor, adj) ]; var matrix: Matrix = new Matrix; matrix.createGradientBox(unscaledWidth, unscaledHeight, Math.PI/2); graphics.lineStyle(1, getStyle('borderColor'), 0.7); drawRoundRect(0, 0, unscaledWidth, unscaledHeight, 7, cols, [1,1], matrix, gt, ratios ); /*with (graphics) { lineStyle(2, 0xFF0000, 0.6); moveTo(0,0); lineTo(unscaledWidth, unscaledHeight); moveTo(unscaledWidth,0); lineTo(0, unscaledHeight); }*/ } } }