Random letter cycling

Hi,

I’m working on a project which involves random letter cycling, without being able to adapt the available codes into as3

like this: http://proto.layer51.com/d.aspx?f=1448

or this one:

import flash.utils.setInterval;

myArray:Array = new Array();
var k:int = 1;
myArray.push(“hello”);
var finterval:uint;
var counter:Number;
var displaytext:TextField=new TextField();
var displayLength:Number = displaytext.length;
var myinterval:uint;
var b:String;

function startoff(displaytext:TextField):void {
k++;
if (k = myArray.length) {
k = 1;
}

myinterval = setInterval(messup, 20);
clearInterval(finterval);

}
function messup(event:Event):void {
counter++;

mystring.text = "";
for (i=0; i<displayLength; i++) {
    b =displaytext.substr(Math.round().Math.floor()*i, 1);
    mystring.appendText(b);
}
if (counter>10) {
    counter = 0;
    clearInterval(myinterval);
    myString.text = displaytext.text;
    finterval = setInterval(startoff, 5000, myArray[k]);
}

}
finterval = setInterval(startoff, 1000, myArray[k]);

does anyone know if there is any available versions of this for as3, or how to migrate?

thank you.