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; 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, 90); borderColor = ColorUtil.adjustBrightness(backgroundColor, -40); var matrix: Matrix = new Matrix(); matrix.createGradientBox(unscaledWidth, unscaledHeight, Math.PI/4); graphics.lineStyle(0, 0, 0); drawRoundRect( padding, padding, unscaledWidth-padding*2, unscaledHeight-padding*2, 2, [backgroundColorAlt, backgroundColor], [0.7, 1], matrix, GradientType.RADIAL, [1, 255] ); with (graphics) { lineStyle(3, borderColor); moveTo(3, 2); lineTo(unscaledWidth - 3, 2); lineStyle(1, borderColor); moveTo(unscaledWidth - 2, 2); lineTo(unscaledWidth - 2, unscaledHeight - 2); lineTo(1, unscaledHeight - 2); lineTo(1, 2); lineStyle(1, borderColor); moveTo(4, 8); lineTo(4, unscaledHeight - 5); lineTo(unscaledWidth - unscaledWidth*0.3, unscaledHeight - 5); lineTo(unscaledWidth - unscaledWidth*0.3, 8); lineStyle(3, borderColor); moveTo(unscaledWidth - unscaledWidth*0.3 - 1, 8); lineTo(5, 8); } } } }