package skins { import flash.display.GradientType; import flash.geom.Matrix; import mx.skins.ProgrammaticSpriteSkin; import mx.utils.ColorUtil; public class AvtSkin extends ProgrammaticSpriteSkin { override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { graphics.clear(); if (getStyle('customIcon')) { addChild(getStyle('customIcon')); } else { var cols : Array = [ getStyle('fillColors')[0], ColorUtil.adjustBrightness(getStyle('fillColors')[0], 70)]; var borderColor : uint = getStyle('borderColor'); var alphas:Array = [1, 1]; var ratios:Array = [0, 0xFF]; var matrix:Matrix = new Matrix(); var padding: Number = unscaledHeight * 0.1; matrix.createGradientBox(unscaledWidth-padding*2, unscaledHeight-padding*2, 0, padding, padding); graphics.lineStyle(1, borderColor, 0); drawRoundRect(padding, padding, unscaledWidth-padding*2, unscaledHeight-padding*2, unscaledHeight-padding*2, cols, alphas, matrix, GradientType.RADIAL, ratios); } } } }