Kirupa's random color

Hi Guys,

Checked out the kirupa easy random color code, but is it possible to call random values from an array of colors?

these examples don’t seem to be working… please help :slight_smile:

var colorArray:Array = new Array("0xFFFF33", "0xFFFFFF", "0x79DCF4", "0xFF3333", "0xFFCC33", "0x99CC33");

function blockRoll(){

myColor = Math.round( Math.random()*colorArray.length );
myColoredObject = new Color (this);
myColoredObject.setRGB(myColor);
};

blockRoll();

or even

var colorArray:Array = new Array("0xFFFF33", "0xFFFFFF", "0x79DCF4", "0xFF3333", "0xFFCC33", "0x99CC33");

function blockRoll(){
this.setRGB(colorArray[Math.round(math.random*6+1)]);
};

blockRoll();