# Random Number will not repeat

**URL:** <https://forum.kirupa.com/t/random-number-will-not-repeat/290004>\
**Category:** flash\
**Created:** [June 8, 2009, 3:27pm UTC](https://forum.kirupa.com/t/random-number-will-not-repeat/290004 "2009-06-08T15:27:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gyan\_Singh](https://avatars.discourse-cdn.com/v4/letter/g/848f3c/32.png) [@Gyan\_Singh](https://forum.kirupa.com/u/Gyan_Singh)\
**Post date:** [June 8, 2009, 3:27pm UTC](https://forum.kirupa.com/t/random-number-will-not-repeat/290004/1 "2009-06-08T15:27:49Z")

</div>

Hi friends,

I am making a number game please help me :-

I have a MovieClip in the library in that movieclip i have a dynamic text field named “numTxt” and i give class name “Ball” from linkage, now i want create 10 movieClip by addChild method.  
i genrate random number in that text feild. and its workning fine.  
but some times some numbers are repeating, thats the problum. the numbers should not be repeat.

```auto
var myBall:Ball;

for (var i:Number = 0; i<10; i++) {
    myBall = new Ball();
    addChild (myBall);
    myBall.x = i * 100
    myBall.newTxt.text = String(Math.ceil(Math.random()*100))
}

```

can anyone help me ???
