var movieClip:MovieClip = new MovieClip();
var grantColorSets = [0xffffff,0xfeffff,0xfefeff,0xfcfdff,0xf9fcfe,0xf6fafe,0xf2f8fd,0xecf5fc,0xe5f1fb,0xddedfa,0xd5e9f9];

for(var i:int = 0 ; i< 11 ; i++ ){
	movieClip.graphics.lineStyle(1,grantColorSets[i]);
	movieClip.graphics.drawRoundRect(0+i, 0+i, 100-i*2, 80-i*2,5,5);
	movieClip.graphics.endFill();
}
movieClip.x = 10;
movieClip.y = 10;
addChild(movieClip);

执行结果如下:

as3.0 矩形边框的颜色渐变代码实现_第1张图片