AS3, how to set random color for text field?

hi kirupa friends :slight_smile:

if i have a simple text field like:


var myText1:TextField = new TextField();
myText1.text = "my text is written here";
myText1.autoSize = TextFieldAutoSize.LEFT;
addChild(myText1);

how can i set a random color for that field?
i found in help files something like:


function getRandomColor():ColorTransform
{
    return new ColorTransform(Math.random(), Math.random(),         Math.random(),1,(Math.random() * 512) - 255,         (Math.random() * 512) -255, (Math.random() * 512) - 255, 0);
}

how do i use it?