# Unique Random Numbers

**URL:** <https://forum.kirupa.com/t/unique-random-numbers/127418>\
**Category:** Uncategorized\
**Created:** [November 2, 2004, 9:47pm UTC](https://forum.kirupa.com/t/unique-random-numbers/127418 "2004-11-02T21:47:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrispy\_mm](https://avatars.discourse-cdn.com/v4/letter/c/ee59a6/32.png) [@chrispy\_mm](https://forum.kirupa.com/u/chrispy_mm)\
**Post date:** [November 2, 2004, 9:47pm UTC](https://forum.kirupa.com/t/unique-random-numbers/127418/1 "2004-11-02T21:47:18Z")

</div>

Looked everywhere for how to do this and not found much, so here goes:

I want to generate a variable number of random numbers less than 16 with no duplicate numbers

Ive posted the fla, and what i’m doing is generating a random number and putting it into an array then using a for loop to cycle through the array for each new random number to check if its already there. if it is, then i want to regenerate that number.

if you test the fla you’ll see that all i get in my array is some lovely zero’s and i sort of know why this is, but don’t know how to stop it.

any help would be much appreciated

cheers

chrispy\_mm

P.S im using Flash MX 2004
