# Text field using actionscript

**URL:** <https://forum.kirupa.com/t/text-field-using-actionscript/192164>\
**Category:** Uncategorized\
**Created:** [June 26, 2006, 6:13pm UTC](https://forum.kirupa.com/t/text-field-using-actionscript/192164 "2006-06-26T18:13:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![puthem1st](https://avatars.discourse-cdn.com/v4/letter/p/ecb155/32.png) [@puthem1st](https://forum.kirupa.com/u/puthem1st)\
**Post date:** [June 26, 2006, 6:13pm UTC](https://forum.kirupa.com/t/text-field-using-actionscript/192164/1 "2006-06-26T18:13:58Z")

</div>

Hello everyone, does anyone know how to create a text field using actionscript. This is what I have so far…

this.createTextField (“my\_txt”, this.getNextHighestDepth(), 215, 100, 300, 100);  
my\_txt.text = “my text goes here.”;

However I am not trying to display text in this dynamic text field I am actually trying to display some random numbers. I am confused as to how I can do this. I have tried using the regular dynamic text box but for some reason my code will not work with this therefore I am tying to do this within the actionscript. The rest of the code I am trying to display is as follows.

generateRandom = function() {  
display.text = Math.ceil(Math.random()\*200);  
}  
function ranEquation(){  
var x1:Number =\_root.\_xmouse;  
var y1:Number =\_root.\_ymouse;

Please Help. Thank you.
