package skins { import flash.display.GradientType; import flash.geom.Matrix; import mx.skins.ProgrammaticSkin; import mx.utils.ColorUtil; public class PrivateChatRestoreButtonSkin extends ProgrammaticSkin { private var padding: Number = 1; private var borderColor: uint; private var backgroundColor: uint; private var backgroundColorAlt: uint; private var radius: uint = 3; override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { // borderColor = getStyle('borderColor'); backgroundColor = getStyle('backgroundColor'); if (name.toLowerCase().indexOf('over') != -1) { backgroundColor = ColorUtil.adjustBrightness(backgroundColor, 20); } backgroundColorAlt = ColorUtil.adjustBrightness(backgroundColor, 120); borderColor = backgroundColorAlt; var matrix: Matrix = new Matrix(); matrix.createGradientBox(unscaledWidth, unscaledHeight, Math.PI*3/4); graphics.lineStyle(2, borderColor, 0.3); drawRoundRect( padding, padding, unscaledWidth-padding*2, unscaledHeight-padding*2, radius, [backgroundColorAlt, backgroundColor], [1, 1], matrix, GradientType.LINEAR, [1, 170] ); graphics.lineStyle(0, 0, 0); var nX: int, nY: int, nW: Number, nH: Number; nW = unscaledWidth*0.5; nH = unscaledHeight*0.3; nX = (unscaledWidth-nW)/2; nY = unscaledHeight - padding - nH - unscaledHeight*0.2; graphics.beginFill(0xFFFFFF, 0.3); drawRoundRect(nX, nY, nW, nH, 1); graphics.endFill(); with (graphics) { beginFill(ColorUtil.adjustBrightness(backgroundColor, -60)); graphics.drawRoundRectComplex(padding, padding, unscaledWidth-padding*2, radius + 2, radius, radius, 0, 0); endFill(); } /*with (graphics) { lineStyle(2, borderColor); moveTo(padding + 4 + 1, padding + 4); lineTo(unscaledWidth - (padding + 4), padding + 4); lineStyle(1, borderColor); lineTo(unscaledWidth - (padding + 4), unscaledHeight - (padding + 4) - 2); moveTo(padding + 3, padding + 8); lineTo(padding + 3, unscaledHeight - padding - 5); lineTo(unscaledWidth - padding - 7, unscaledHeight - padding - 5); lineTo(unscaledWidth - padding - 7, padding + 8); lineStyle(2, borderColor); lineTo(padding + 3, padding + 8); }*/ } } }