# Math.random() for certain numbers

**URL:** https://forum.kirupa.com/t/math-random-for-certain-numbers/286613
**Category:** flash
**Created:** [April 17, 2009, 6:11pm UTC](https://forum.kirupa.com/t/math-random-for-certain-numbers/286613 "2009-04-17T18:11:55Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![DanDaMan](https://avatars.discourse-cdn.com/v4/letter/d/b19c9b/32.png) [@DanDaMan](https://forum.kirupa.com/u/DanDaMan)
#### Post date: [April 17, 2009, 6:11pm UTC](https://forum.kirupa.com/t/math-random-for-certain-numbers/286613/1 "2009-04-17T18:11:55Z")

</div>

I have a function that creates a Movieclip every two seconds. I want each Movieclip to go to a random frame. But if there is already a Movieclip on the stage that is currently on frame 4 (for example), then no other Movieclips can be on frame 4 until the other Movieclip on frame 4 is removed. How would I do this? Thank you in advance.
