package skins { import mx.skins.ProgrammaticSkin; import mx.utils.ColorUtil; public class TitleWindowCloseButton extends ProgrammaticSkin { private var lineAlpha: Number = 1; private var lineColor: uint = 0xFFFFFF; private var lineThickness: int = 1; private var backgroundColor: uint; override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { graphics.clear(); var action: String = (name.toLowerCase().indexOf('minimize') == -1) ? 'close' : 'min'; if (getStyle(action + 'Colors').length) { if (name.toLowerCase().indexOf('over') != -1) { backgroundColor = ColorUtil.adjustBrightness(getStyle(action + 'Colors')[1], 60); } else if (name.toLowerCase().indexOf('down') != -1) { backgroundColor = getStyle(action + 'ColorsPress')[1]; } else { backgroundColor = getStyle(action + 'Colors')[1]; } } drawRoundRect(0, 0, unscaledWidth, unscaledHeight, 0, backgroundColor, 0.7); var cX: Number = unscaledWidth/2; var cY: Number = unscaledHeight/2; var rad: Number = 3; with (graphics) { lineStyle(lineThickness, lineColor, lineAlpha); if ('min' == action) { moveTo(cX - rad, cY); lineTo(cX + rad, cY); } else { moveTo(cX - rad, cY - rad); lineTo(cX + rad, cY + rad); moveTo(cX + rad, cY - rad); lineTo(cX - rad, cY + rad); } } } } }