package skins { import mx.skins.ProgrammaticSkin; public class TitleWindowCloseButton extends ProgrammaticSkin { private var lineAlpha: Number = 0.8; private var lineColor: int = 0x444444; private var lineThickness: int = 2; override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { unscaledWidth = 14; unscaledHeight = 14; var action: String = (name.toLowerCase().indexOf('minimize') == -1) ? 'close' : 'min'; if (action + 'ButtonDownSkin' == name) { unscaledWidth = unscaledHeight = 16; } graphics.clear(); lineColor = getStyle('borderColor'); drawRoundRect(0, 0, unscaledWidth, unscaledHeight, 0, 0, 0); if (name.toLowerCase().indexOf('down') != -1) { lineAlpha = 0.8; } else if (name.toLowerCase().indexOf('over') != -1) { lineAlpha = 0.4; } with (graphics) { // var cX: int = unscaledWidth/2; // var cY: int = unscaledHeight/2; lineStyle(lineThickness, lineColor, lineAlpha); if ('min' == action) { moveTo(2,unscaledHeight/2 - 1); lineTo(unscaledWidth-1,unscaledHeight/2); } else { moveTo(3, 1); lineTo(unscaledWidth - 4, unscaledHeight - 2); moveTo(unscaledWidth - 1, 1); lineTo(4, unscaledHeight - 4); } } } } }