# Adding new text

**URL:** <https://forum.kirupa.com/t/adding-new-text/232844>\
**Category:** Uncategorized\
**Created:** [July 18, 2007, 8:54am UTC](https://forum.kirupa.com/t/adding-new-text/232844 "2007-07-18T08:54:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sger\_error](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@sger\_error](https://forum.kirupa.com/u/sger_error)\
**Post date:** [July 18, 2007, 8:54am UTC](https://forum.kirupa.com/t/adding-new-text/232844/1 "2007-07-18T08:54:35Z")

</div>

hello,

heres my simple custom class for creating textfields

public static function createText(container :Sprite,  
value :String,  
selectable:Boolean,  
autoSize :String,  
embed :Boolean = false,  
textFormat:TextFormat = null):TextField{

```
        var textField:TextField = new TextField();
        textField.selectable = selectable;
        textField.autoSize = autoSize;
        textField.embedFonts = embed;
        textField.text = value;
        
        container.addChild(textField);
        
        if(embed){
            textField.setTextFormat(textFormat);
                
        }
        
        return textField;

```

my problem is when i’m trying to re-assing new value text like

textField.text = “some text”;

the textField is empty

any ideas?
