package skins { import mx.skins.ProgrammaticSkin; public class ButtonSkin extends ProgrammaticSkin { private var colBackground: uint = 0xFFFFFF; private var colBorder: uint = 0; private var borderThickness: uint = 1; private var borderAlpha: Number = 1; private var backgroundAlpha: Number = 1; override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { graphics.clear(); colBorder= getStyle('borderColor'); colBackground = getStyle('fillColors')[0]; switch (name) { case "upSkin": break; case "overSkin": colBackground = getStyle('downFillColors')[0]; break; case "downSkin": break; case "disabledSkin": alpha = 0.3; break; } graphics.lineStyle(borderThickness, colBorder, borderAlpha); drawRoundRect(0, 0, unscaledWidth, unscaledHeight, 0, colBackground, backgroundAlpha); } } }