# Dividing Number X (30, 25, 13, etc..) amongst text fields (1-100 fields)

**URL:** <https://forum.kirupa.com/t/dividing-number-x-30-25-13-etc-amongst-text-fields-1-100-fields/228945>\
**Category:** flash\
**Created:** [June 12, 2007, 8:19pm UTC](https://forum.kirupa.com/t/dividing-number-x-30-25-13-etc-amongst-text-fields-1-100-fields/228945 "2007-06-12T20:19:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lemuel](https://avatars.discourse-cdn.com/v4/letter/l/f9ae1b/32.png) [@Lemuel](https://forum.kirupa.com/u/Lemuel)\
**Post date:** [June 12, 2007, 8:19pm UTC](https://forum.kirupa.com/t/dividing-number-x-30-25-13-etc-amongst-text-fields-1-100-fields/228945/1 "2007-06-12T20:19:36Z")

</div>

Sorry about the title of this post, but I didn’t find it easy to make a descriptive title.

What I’m trying to do, isn’t a huge project, and I don’t believe it’s infinitely complicated. I just can’t seem to wrap my head around it at the moment.

Hard enough to explain what I want…

Try to picture this:

Flash file opens up.  
There are 6 text fields on the screen.  
You enter the number 30 into a text field located near the top and press a button.  
The 5 remaining text fields suddenly have numbers in them:  
[LIST]  
[\*]Field 1: 30

[\*]Field 2:8

[\*]Field 3:9

[\*]Field 4:3

[\*]Field 5:5

[\*]Field 6:5  
[/LIST]

The idea is that I need a piece of code that will divide a variable amount of ‘points’ between a variable number of text fields. But not only does it have to be divided it has to be randomly and often unevenly divided.

So X = Number of text fields X / 30  
Won’t bring about the desired results.

I think I can (but haven’t tried) divide 30 evenly easy enough, but since thats not what I’m after…

Any suggestions?

Seems to me that the final code will be one of those ‘_Wonder why I didn’t see that_’ sort of things. But I can’t get it.

Thanks for your help.

-Lem
