package skins { import mx.controls.Alert; import mx.skins.Border; public class AccordionButton extends Border { private var colBackground: uint = 0xFFFFFF; private var colBorder: uint = 0; private var borderThickness: uint = 1; private var borderAlpha: Number = 1; private var backgroundAlpha: Number = 1; private var arrColor: uint = 0xFFFFFF; private var isUp: Boolean = false; override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { graphics.clear(); colBorder= getStyle('borderColor'); arrColor = getStyle('arrColor'); colBackground = getStyle('fillColors')[0]; switch (name) { case "skin": break; case "overSkin": colBackground = getStyle('downFillColors')[0]; case "downSkin": arrColor = colBorder; break; } if (name.indexOf('elected') > 0) { isUp = true; } graphics.lineStyle(borderThickness, colBorder, borderAlpha); drawRoundRect(0, 0, unscaledWidth - 1, unscaledHeight-2, 0, colBackground, backgroundAlpha); with (graphics) { lineStyle(2, colBorder, borderAlpha); moveTo(1, unscaledHeight - 2); lineTo(unscaledWidth - 1, unscaledHeight - 2); } var cX: Number = unscaledWidth - 8; var cY: Number = unscaledHeight / 2 - 1; with (graphics) { if (isUp) { cY -= 3; lineStyle(2, arrColor, borderAlpha); moveTo(cX - 3, cY + 3); lineTo(cX, cY); lineTo(cX + 3, cY + 3); cY += 4; moveTo(cX - 3, cY + 3); lineTo(cX, cY); lineTo(cX + 3, cY + 3); } else { lineStyle(2, arrColor, borderAlpha); moveTo(cX - 3, cY - 3); lineTo(cX, cY); lineTo(cX + 3, cY - 3); cY += 4; moveTo(cX - 3, cY - 3); lineTo(cX, cY); lineTo(cX + 3, cY - 3); } } } } }