How to create a random effect with "setInterval"

[font=Times New Roman][size=3]By way of practice I wanted to create a “Typewriter” effect output to display a “Welcome” message followed by a users name (please click [/size][/font]HERE[font=Times New Roman][size=3]), which would have been inputted in the first frame of a movie.[/size][/font]

[font=Times New Roman]Using the below code everything works great, but……[/font]

[font=Times New Roman]How can I get the loop typing out the users name to do so in a more random “timed” fashion, like it would be on a real typewriter, where there would be a delay before each “clack” as the person using the machine hunted for the correct keys.[/font]

[font=Times New Roman]The “Welcome” part has got the right feel, as obviously this is not created dynamically. I have tried a “setInterval” function but obviously this just sets the timing once for the whole loop, as the loop will have executed or started to execute before the set interval would have expired.[/font]

[font=Times New Roman]Any help please.[/font]

[color=darkorange][font=Times New Roman][color=blue]FRAME 2[/color][/font] [/color]

[font=Times New Roman][color=darkorange]tip=new Array();[/color][/font]

[font=Times New Roman][color=darkorange]for(n;n<flip.length;n++){[/color][/font]

[font=Times New Roman][color=darkorange]sank+=flip.charAt(n) + “,”}[/color][/font]

[font=Times New Roman][color=darkorange]sank=sank.slice(0,-1);[/color][/font]

[font=Times New Roman][color=darkorange]sank=sank.split(",");[/color][/font]

[font=Times New Roman][color=darkorange]my_fmt=new TextFormat();[/color][/font]

[font=Times New Roman][color=darkorange]my_fmt.color=0x666666;[/color][/font]

[font=Times New Roman][color=darkorange]my_fmt.size=40;[/color][/font]

[font=Times New Roman][color=darkorange]my_fmt.font="_typewriter";[/color][/font]

[font=Times New Roman][color=darkorange]count=0[/color][/font]

[font=Times New Roman][color=darkorange]for(r=0;r<sank.length;r++){[/color][/font]

[font=Times New Roman][color=darkorange]count++[/color][/font]

[font=Times New Roman][color=darkorange]root.createTextField("f "+count,count,50*count,100,50,50);[/color][/font]

[font=Times New Roman][color=darkorange]root["f " +count].setNewTextFormat(my_fmt);[/color][/font]

[font=Times New Roman][color=darkorange]root["f " +count]._visible=true;[/color][/font]

[color=darkorange][font=Times New Roman]}[/font] [/color]

[font=Times New Roman][color=blue]OTHER FRAME[/color][/font]

[font=Times New Roman][color=darkorange]stop();[/color][/font]

[font=Times New Roman][color=darkorange]car=1;[/color][/font]

[font=Times New Roman][color=darkorange]cart=0;[/color][/font]

[font=Times New Roman][color=darkorange]function show(){root["f " +car].text=sank[cart];[/color][/font]

[font=Times New Roman][color=darkorange]my_sound=new Sound();[/color][/font]

[font=Times New Roman][color=darkorange]my_sound.attachSound(“beak”);[/color][/font]

[font=Times New Roman][color=darkorange]my_sound.start()[/color][/font]

[font=Times New Roman][color=darkorange]car++;[/color][/font]

[font=Times New Roman][color=darkorange]cart++[/color][/font]

[font=Times New Roman][color=darkorange]if (cart>=sank.length){clearInterval(int)};[/color][/font]

[font=Times New Roman][color=darkorange]};[/color][/font]

[font=Times New Roman][color=darkorange]int=setInterval(show,Math.floor(Math.random()*3000)+1);[/color][/font]