# Random math

**URL:** <https://forum.kirupa.com/t/random-math/12068>\
**Category:** Uncategorized\
**Created:** [January 26, 2003, 8:58am UTC](https://forum.kirupa.com/t/random-math/12068 "2003-01-26T08:58:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![korrupt](https://avatars.discourse-cdn.com/v4/letter/k/e56c9b/32.png) [@korrupt](https://forum.kirupa.com/u/korrupt)\
**Post date:** [January 26, 2003, 8:58am UTC](https://forum.kirupa.com/t/random-math/12068/1 "2003-01-26T08:58:27Z")

</div>

Hey Kirupa, Thanks for the help on the random math tutorials, but I’m having a problem displaying the actual number. Would I make a variable of it?

Here’s the code I got from the tut:

Math.floor(Math.random()\*(25-15))+7;

How do I display it in a text box now, or make it variable or… :q:

Thanks,  
KoRRupt

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 26, 2003, 9:23am UTC](https://forum.kirupa.com/t/random-math/12068/2 "2003-01-26T09:23:59Z")

</div>

You don’t have to make it a variable but it’s better that way!

yourvariable = Math.floor(Math.random()\*(25-15))+7;  
yourtextbox = yourvariable;

change yourvariable to whatever you like and yourtextbox to the variable name of the tetbox you want the text to be displayed!  
But without the variable the code should look like this:

yourtextbox = Math.floor(Math.random()\*(25-15))+7;

yourtextbx = your variable name of da textbox

:bounce:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 26, 2003, 9:29am UTC](https://forum.kirupa.com/t/random-math/12068/3 "2003-01-26T09:29:00Z")

</div>

Thanks Skyo for the fast response! That helped answer everything I was looking for. I’m new to actionscripting, I just started taking tutorials yesterday… Thanks fro clearing things up!

Happy Animating!  
-KoRRupt
