# Need help on random random(with no duplicate or repeated frames)

**URL:** https://forum.kirupa.com/t/need-help-on-random-random-with-no-duplicate-or-repeated-frames/134668
**Category:** Uncategorized
**Created:** [January 20, 2005, 12:34pm UTC](https://forum.kirupa.com/t/need-help-on-random-random-with-no-duplicate-or-repeated-frames/134668 "2005-01-20T12:34:05Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![franciseah](https://avatars.discourse-cdn.com/v4/letter/f/b4bc9f/32.png) [@franciseah](https://forum.kirupa.com/u/franciseah)
#### Post date: [January 20, 2005, 12:34pm UTC](https://forum.kirupa.com/t/need-help-on-random-random-with-no-duplicate-or-repeated-frames/134668/1 "2005-01-20T12:34:05Z")

</div>

currently i doing something like 1 fla with 17 frame inside it…1st frame is just consist of a button “playrandom” and other 16 is just some graphics with a button(back).when click on “playrandom” button, it will go to random frame.(i had done this).but now the problem is, when i click “back” button go back to the 1st frame and click on the on the “playrandom” button,there is a chance i will get the same frame or duplicate random frame.what can i do to check to make sure there is no duplicate frame…

and the other problem is after all the 16 random have choose, i would like to reset the numbers.which mean u can have same frames after all the 16 frame have choose.

below is some of my codes  
ran =Math.floor(Math.random()\*15 +1);//0-16  
gotoandplay(ran+1);//because the 1st of the 16 frame is in frame 2
