Here is one possible solution for Quiz #12.

This example uses beginGradientFill and is an attempt at being somewhat simple and readable. It is a slight variation on the version from the book I wrote with Rich Shupe (Learning ActionScript 3.0).
makeColorPicker(300);

function makeColorPicker(size:Number=100):Sprite{
	var colorPicker:Sprite = new Sprite();
	
	var colors:Array = [0xFF0000, 0xFFFF00, 0x00FF00,0x00FFFF,0x0000FF,0xFF00FF, 0xFF0000];
    var alphas:Array = [1, 1, 1, 1, 1, 1, 1];
    var ratios:Array = [0, 42, 84, 126, 168, 210, 255];
	
    drawGradientBox(colorPicker.graphics, size, colors, alphas, ratios, 0);

	colors = [0x000000, 0x000000];
	alphas = [1, 0];
	ratios = [0, 255];
	
	drawGradientBox(colorPicker.graphics, size, colors, alphas, ratios, radians(-90));
	 
	return addChild(colorPicker);
}

function drawGradientBox(g:Graphics, size:uint, colors:Array, alphas:Array, ratios:Array, rot:Number):void {
	var mat:Matrix = new Matrix();
	mat.createGradientBox(size, size, rot, 0, 0);
	g.beginGradientFill(GradientType.LINEAR, colors, alphas, ratios, mat);
	g.drawRect(0, 0, size, size);
}

function radians(degrees:Number):Number {
	return degrees * Math.PI / 180;
}