# Random items from array

**URL:** <https://forum.kirupa.com/t/random-items-from-array/246902>\
**Category:** Uncategorized\
**Created:** [December 16, 2007, 4:01am UTC](https://forum.kirupa.com/t/random-items-from-array/246902 "2007-12-16T04:01:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![badmonur](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@badmonur](https://forum.kirupa.com/u/badmonur)\
**Post date:** [December 16, 2007, 4:01am UTC](https://forum.kirupa.com/t/random-items-from-array/246902/1 "2007-12-16T04:01:37Z")

</div>

I want to display multiple random objects of an array. My terrain array and terrain length have been declared elseware. How do i make that code produce more than one item from that array

```auto
function genTRN () {
_ter=random(_root.ter_len)
trn_txt.text=_root.terrain[_ter]

}

```
