package skins { import flash.display.GradientType; import flash.geom.Matrix; import mx.skins.Border; import mx.utils.ColorUtil; public class TitleBorder extends Border { private var backgroundColor: uint = 0xFFFFFF; private var backgroundColorAlt: uint = 0xFFFFFF; private var borderColor: uint = 0; private var borderThickness: uint = 1; private var borderAlpha: Number = 1; private var backgroundAlpha: Number = 1; private var borderOutThickness: Number = 2; override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { graphics.clear(); borderColor = getStyle('borderColor'); backgroundColor = getStyle('backgroundColor'); super.updateDisplayList(unscaledWidth, unscaledHeight); var headerHeight: Number = (getStyle('headerHeight')) ? getStyle('headerHeight') : 0; unscaledHeight-=1; graphics.lineStyle(1, borderColor, 1); graphics.beginFill(backgroundColor, 1); drawRoundRect(0, headerHeight, unscaledWidth, unscaledHeight-headerHeight, 0, backgroundColor, 1); graphics.endFill(); if (getStyle('headerHeight')) { var rad: Number = 15; backgroundColor = getStyle('buttonBackground'); backgroundColorAlt = ColorUtil.adjustBrightness(backgroundColor, 90); graphics.lineStyle(0, 0, 0); var matrix: Matrix = new Matrix(); matrix.createGradientBox(unscaledWidth, headerHeight, Math.PI/2); graphics.beginGradientFill( GradientType.LINEAR, [backgroundColorAlt, ColorUtil.adjustBrightness(backgroundColorAlt, 60), ColorUtil.adjustBrightness(backgroundColorAlt, 60),backgroundColorAlt], [1, 1, 1, 1], [0, 55, 200, 255], matrix); graphics.drawRoundRectComplex(0, 1, unscaledWidth, headerHeight, rad, rad, 0, 0); graphics.endFill(); with (graphics) { lineStyle(1, backgroundColor, 0.5); for (var i: int = 60; i < unscaledWidth - 60; i+= 4) { moveTo(i, 1); lineTo(i, headerHeight); } } } } } }