# Calling a random array

**URL:** <https://forum.kirupa.com/t/calling-a-random-array/272106>\
**Category:** Uncategorized\
**Created:** [October 2, 2008, 2:50am UTC](https://forum.kirupa.com/t/calling-a-random-array/272106 "2008-10-02T02:50:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stumped](https://avatars.discourse-cdn.com/v4/letter/s/46a35a/32.png) [@stumped](https://forum.kirupa.com/u/stumped)\
**Post date:** [October 2, 2008, 2:50am UTC](https://forum.kirupa.com/t/calling-a-random-array/272106/1 "2008-10-02T02:50:33Z")

</div>

I have set up a small database using multiple arrays. The Arrays are named “Array1”, “Array2”, “Array3”. Each array has six items. I want to use a random number to pick the array and then get one of the items from the array. My problem is that I have no idea what the proper format would be to get the information from the array. No matter what I have tried I get an “error undefined”

Array1 = new Array(“2”,“1”,“19”,“ba”,“at”,“6”);  
Array2 = new Array(“2”,“5”,“4”,“be”,“ed”,“8”);  
Array3 = new Array(“2”,“15”,“22”,“bo”,“ox”,“9”);

item = Math.ceil(Math.random()\*3);  
trace (“Array”+item+[5]);

Thanks in advance for the help … Michael
