Random change font of text box

Hi all,

I have code for a typewriter type effect where the text is added one letter at a time, this is fine but I wanted the font used to be random from a list of fonts.
The fonts in font_arr i have placed in the library with NEW FONT, and in the linkage exported for actionscript.

[AS]
font_arr = [“Baskerville”, “AppleGothic”, “American Typewriter”];
startRan = Math.floor(Math.random()*font_arr.length);
changeFont(font_arr[startRan], textBox_txt);
trace(font_arr[startRan]);
this.onLoad = function() {
typeInterval = setInterval(typeset, 50);
};
k = 0;
typeset = function () {
text = “testing testing testing testing”;
if (k<text.length) {
textBox_txt.text = text.substring(0, k);
k++;
} else {
textBox_txt.text = text;
clearInterval(typeInterval);
}
};
changeFont = function (fontface, where) {
myFont = new TextFormat();
myFont.font = fontface;
where.setTextFormat(myFont);
};
[/AS]