# Create a textField in a random place of the stage

**URL:** <https://forum.kirupa.com/t/create-a-textfield-in-a-random-place-of-the-stage/274279>\
**Category:** flash\
**Created:** [October 27, 2008, 11:19pm UTC](https://forum.kirupa.com/t/create-a-textfield-in-a-random-place-of-the-stage/274279 "2008-10-27T23:19:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cosianfiro](https://avatars.discourse-cdn.com/v4/letter/c/edb3f5/32.png) [@cosianfiro](https://forum.kirupa.com/u/cosianfiro)\
**Post date:** [October 27, 2008, 11:19pm UTC](https://forum.kirupa.com/t/create-a-textfield-in-a-random-place-of-the-stage/274279/1 "2008-10-27T23:19:21Z")

</div>

Hi, I’m trying to make a textfield appears in a random place of my stage everytime i click on it (stage).

this is my code until now:

stage.addEventListener(MouseEvent.CLICK, myFunction);  
function myFunction(myevent:MouseEvent):void {  
var myText:TextField = new TextField;  
var myTextFormat:TextFormat = new TextFormat;

myTextFormat.color = Math.random() \*0xffffff;  
myTextFormat.size = Math.random() \*20;

myText.text = “This is my text”;  
myText.autoSize = TextFieldAutoSize.LEFT;  
addChild(myText);  
}

really i try to make a textfield only in B/W (no more colors, but with a random alpha value).  
yeah i’m a randomholic…

random size, random place, random alpha, random rotation, and even random font. thats what i wanna make.

plz, any suggestions or ideas?

thx.
