package skins { import flash.display.GradientType; import flash.display.InterpolationMethod; import flash.display.SpreadMethod; import flash.geom.Matrix; import mx.skins.ProgrammaticSkin; import mx.utils.ColorUtil; public class ComboSkin extends ProgrammaticSkin { private var colBackground: uint = 0xFFFFFF; private var colListBackground: uint = 0xFFFFFF; private var colBorder: uint = 0; private var borderThickness: uint = 1; private var borderAlpha: Number = 1; private var backgroundAlpha: Number = 1; private var arrowZoneWidth: Number = 14; private var arrColor: uint = 0xFFFFFF; private var radius: Number = 5; override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { graphics.clear(); colBorder= getStyle('borderColor'); arrColor = getStyle('arrColor'); colBackground = getStyle('fillColors')[0]; colListBackground = getStyle('fillColors')[0]; switch (name) { case "upSkin": break; case "overSkin": colBackground = ColorUtil.adjustBrightness(getStyle('fillColors')[0], 60); break; case "downSkin": break; case "disabledSkin": alpha = 0.3; break; } graphics.lineStyle(borderThickness, colBorder, borderAlpha); drawRoundRect(0, 0, unscaledWidth, unscaledHeight, 0, colListBackground, backgroundAlpha); var typeGlare:String = GradientType.RADIAL; var colors:Array = [ 0xFFFFFF, colBackground]; var spreadMethodGlare:String = SpreadMethod.PAD; var interpGlare:String = InterpolationMethod.LINEAR_RGB; var focalPtRatioGlare:Number = 0; var matrixGlare:Matrix = new Matrix(); var boxWidthGlare:Number = unscaledHeight; var boxHeightGlare:Number = unscaledHeight; var boxRotationGlare:Number = Math.PI/2; // 90˚ var txGlare:Number = unscaledWidth - arrowZoneWidth - unscaledHeight/2 + 4; var tyGlare:Number = - unscaledHeight/2 + 6; matrixGlare.createGradientBox(boxWidthGlare, boxHeightGlare, boxRotationGlare, txGlare, tyGlare); graphics.beginGradientFill(typeGlare, colors, [0.5, 0.3], [0, 0x88], matrixGlare, spreadMethodGlare, interpGlare, focalPtRatioGlare); graphics.drawRoundRect( unscaledWidth - arrowZoneWidth, 0, arrowZoneWidth, unscaledHeight, 8, 8); graphics.endFill(); var cX: Number = unscaledWidth - arrowZoneWidth/2 + 1; var cY: Number = unscaledHeight/2; with (graphics) { lineStyle(2, arrColor, 1); moveTo(cX - 3, cY - 1); lineTo(cX, cY + 2); lineTo(cX + 3, cY - 1); } } } }