package skins { import flash.display.GradientType; import flash.geom.Matrix; import mx.controls.Alert; import mx.core.UIComponent; import mx.skins.Border; import mx.utils.ColorUtil; public class TitleBorder extends Border { private var colBackground: uint = 0xFFFFFF; private var colBackgroundAlt: uint = 0xFFFFFF; private var colBorder: 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(); colBorder = getStyle('borderColor'); colBackground = getStyle('backgroundColor'); super.updateDisplayList(unscaledWidth, unscaledHeight); var headerHeight: Number = getStyle('headerHeight'); var colBorderOut: uint = ColorUtil.adjustBrightness(colBackground, 0); var colBorderOutAlt: uint = ColorUtil.adjustBrightness(colBorderOut, 150); unscaledHeight-=1; graphics.lineStyle(1, colBorder, 1); graphics.beginFill(colBackground, 1); drawRoundRect(0, 0, unscaledWidth, unscaledHeight, 0, colBackground, 1); graphics.endFill(); if (getStyle('headerHeight')) { colBackground = getStyle('buttonBackground'); colBackgroundAlt = ColorUtil.adjustBrightness(colBackground, 90); graphics.lineStyle(0, 0, 0); var matrix: Matrix = new Matrix(); matrix.createGradientBox(unscaledWidth, headerHeight, Math.PI/2); drawRoundRect(0, 1, unscaledWidth, headerHeight, 0, [colBackgroundAlt, colBackground], [backgroundAlpha, backgroundAlpha], matrix, GradientType.LINEAR, [0, 255]); var cX: Number = unscaledWidth - 15; var cY: Number = headerHeight / 2; with (graphics) { lineStyle(1, colBackground, 1); moveTo(1, cY); lineTo(unscaledWidth-1, cY); cY++; lineStyle(1, colBackgroundAlt, 1); moveTo(1, cY); lineTo(unscaledWidth-1, cY); } } } } }