# AS3 TextField

**URL:** <https://forum.kirupa.com/t/as3-textfield/311557>\
**Category:** flash\
**Created:** [July 9, 2010, 10:58pm UTC](https://forum.kirupa.com/t/as3-textfield/311557 "2010-07-09T22:58:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrpercival](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@mrpercival](https://forum.kirupa.com/u/mrpercival)\
**Post date:** [July 9, 2010, 10:58pm UTC](https://forum.kirupa.com/t/as3-textfield/311557/1 "2010-07-09T22:58:32Z")

</div>

Hi ,

I have a Textfield that I have drawn on the stage.  
I have another TextField that I have created in AS3.

The TextField I created in AS3 appears on the stage without an issue.

However, I am later setting the TEXT of both TextFields to the same variable , the TextField I drew on the stage, it shows no problem, the one I created in AS3 , it comes up blank.

The two calls to update the text are right under each other, so the variable cant be unsetting between them (at least I dont see how it would be).

here is the code I used to create the TextField

```auto

var TilesLeft2:TextField = new TextField();
TilesLeft2.defaultTextFormat = titleFormat;
TilesLeft2.embedFonts = true;

TilesLeft2.autoSize = TextFieldAutoSize.LEFT;
TilesLeft2.defaultTextFormat = titleFormat;

TilesLeft2.text = "Testing";
TilesLeft2.x=25;
TilesLeft2.y=445;
addChild(TilesLeft2);

```

at this point Testing does appear on the stage, so that part is working

then I set the text values

```auto

TilesLeft.text= String(bag); <-- this is the TextField I drew on the stage 

TilesLeft2.text= String(bag);

```

TilesLeft will show the number 92 , TilesLeft2 changes to blank.  
I tried added some non-dynamic text to tilesLeft2 like this:

```auto
TilesLeft.text= String(bag);
TilesLeft2.text= "hello" + String(bag);

```

TilesLeft changes to 92. TilesLeft2 just shows “hello”

What am I doing wrong?
