# Random numbers failing

**URL:** https://forum.kirupa.com/t/random-numbers-failing/323147
**Category:** flash
**Created:** [June 18, 2011, 8:45pm UTC](https://forum.kirupa.com/t/random-numbers-failing/323147 "2011-06-18T20:45:34Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ben1996123](https://avatars.discourse-cdn.com/v4/letter/b/a87d85/32.png) [@ben1996123](https://forum.kirupa.com/u/ben1996123)
#### Post date: [June 18, 2011, 8:45pm UTC](https://forum.kirupa.com/t/random-numbers-failing/323147/1 "2011-06-18T20:45:34Z")

</div>

So I have been able to generate random numbers before, but now they just seem to be spazzing out randomly.

I created 4 dynamic textboxes with the variable names item1, item2, item3 and item4. The code that I have used on the frame is:

```auto
item1=random(5)+1
item2=random(10)+1
item3=random(3)+1
item4=random(201)

```

But whenever I run the program, sometimes it generates a number between 1 and 4, sometimes it doesn’t generate anything and the textbox stays blank… It seems to work fine when I only have one textbox though… Help?
