package skins { import mx.skins.Border; public class TitleBorder extends Border { private var colBackground: uint = 0xFFFFFF; private var colStrip: uint = 0x444444; private var padding: uint = 1; private var stripAlpha: Number = 0.3; private var borderThickness: uint = 3; private var borderAlpha: Number = 0.5; private var backgroundAlpha: Number = 1; override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { graphics.clear(); colStrip = getStyle('borderColor'); colBackground = getStyle('backgroundColor'); super.updateDisplayList(unscaledWidth, unscaledHeight); drawRoundRect(0, 0, unscaledWidth, unscaledHeight, 0, 0, 0); with (graphics) { beginFill(colBackground, backgroundAlpha); lineStyle(borderThickness, colStrip, borderAlpha); moveTo(0, 0); lineTo(unscaledWidth+2, -4); lineTo(unscaledWidth, unscaledHeight); lineTo(-2, unscaledHeight + 3); lineTo(0, 0); endFill(); } if (getStyle('headerHeight') > 15) { var sX: int, sY: int, eX: int, eY: int, next: int; graphics.lineStyle(1, colStrip, stripAlpha); var headerHeight: Number = 25; sX = 3; sY = headerHeight - 4; graphics.moveTo(sX, sY); var isUp: Boolean = true; eX = 0; var padding: Number; with (graphics) { while (eX < unscaledWidth - 10 ) { padding = Math.min((unscaledWidth - eX)/unscaledWidth * (headerHeight - 4)/2, headerHeight/2 - 6); padding += Math.random()*4-2; if (isUp) { eY = 3 + padding; eX += headerHeight*2; } else { eY = headerHeight - padding; eX -= headerHeight; } if (eX >= unscaledWidth) { eX = unscaledWidth; } eX += Math.random()*4-8; eY += Math.random()*3-6; lineTo(eX, eY); isUp = !isUp; } } } } } }