# Array problems

**URL:** https://forum.kirupa.com/t/array-problems/84654
**Category:** Uncategorized
**Created:** [March 29, 2005, 2:20pm UTC](https://forum.kirupa.com/t/array-problems/84654 "2005-03-29T14:20:29Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![RabBell](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/rabbell/32/340_2.png) [@RabBell](https://forum.kirupa.com/u/RabBell)
#### Post date: [March 29, 2005, 2:20pm UTC](https://forum.kirupa.com/t/array-problems/84654/1 "2005-03-29T14:20:29Z")

</div>

ok, I got a few problems…mostly cause it’s been a while since I done any actionscript or work with flash, anyway

here is the code:

var alphabets = new Array();  
alphabets[0] = “A”;  
alphabets[1] = “B”;  
alphabets[2] = “C”;  
alphabets[3] = “D”;  
alphabets[4] = “E”;  
alphabets[5] = “F”;  
alphabets[6] = “G”;  
alphabets[7] = “H”;  
alphabets[8] = “I”;  
alphabets[9] = “J”;  
alphabets[10] = “K”;  
alphabets[11] = “L”;  
alphabets[12] = “M”;  
alphabets[13] = “N”;  
alphabets[14] = “O”;  
alphabets[15] = “P”;  
alphabets[16] = “Q”;  
alphabets[17] = “R”;  
alphabets[18] = “S”;  
alphabets[19] = “T”;  
alphabets[20] = “U”;  
alphabets[21] = “V”;  
alphabets[22] = “W”;  
alphabets[23] = “X”;  
alphabets[24] = “Y”;  
alphabets[25] = “Z”;  
stop();

function getF(){  
var ltimes,lnum,lpick;  
ltimes = 8;  
lnum = 0;  
while (lnum \< ltimes){  
lpick = Math.random()\*25;  
lpick = Math.round(lpick);  
firstletter.text = alphabets(lpick);  
lnum = lnum + 1;  
}  
}

What I have in the movie is a dynamic text box called firstletter and a button. Clicking on this button calls the getF function…

the code aboce gives me an ‘undefined’ message…any help would be great :beam:

oh and if someone could point me towards an actionscript delay, that would be good too :thumb:
