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, 120); borderColor = backgroundColorAlt; 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, 5, [backgroundColorAlt, backgroundColor], [1, 1], matrix, GradientType.LINEAR, [1, 120] ); 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); } } } }