package skins { import flash.display.DisplayObject; import flash.display.GradientType; import flash.geom.Matrix; import mx.skins.ProgrammaticSpriteSkin; import mx.utils.ColorUtil; public class PrivateChatRestoreButtonSkin extends ProgrammaticSpriteSkin { private var padding: Number = 1; private var borderColor: uint; private var backgroundColor: uint; private var backgroundColorAlt: uint; [Embed(source='shape.swf')] private var icon: Class; 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/2); drawRoundRect(0, 0, unscaledWidth, unscaledHeight, 5, [backgroundColorAlt, backgroundColor], [1, 1], matrix, GradientType.LINEAR, [1, 150]); var img:DisplayObject = new icon; img.height = unscaledHeight*0.6; img.width = unscaledWidth*0.6; img.y = (unscaledHeight-img.height)/2; img.x = (unscaledWidth-img.width)/2; addChild(img); } } }