# New TextField() not displaying?

**URL:** <https://forum.kirupa.com/t/new-textfield-not-displaying/307997>\
**Category:** Uncategorized\
**Created:** [April 14, 2010, 8:01pm UTC](https://forum.kirupa.com/t/new-textfield-not-displaying/307997 "2010-04-14T20:01:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![snowman4415](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@snowman4415](https://forum.kirupa.com/u/snowman4415)\
**Post date:** [April 14, 2010, 8:01pm UTC](https://forum.kirupa.com/t/new-textfield-not-displaying/307997/1 "2010-04-14T20:01:25Z")

</div>

Hello,

I have an actionscript class, and when I make a new one, the constructor is suposed to create a new textfield. but nothing shows up. here is my .as file:

```auto
package scripts
{
    import flash.display.Sprite;
    import flash.text.TextField;
    import flash.text.TextFieldType;
 
 public class QuizSentence extends Sprite
 {
  
  public function QuizSentence():void{
   trace("constructor");
   
   var myText:TextField = new TextField();
   myText.text = "Republic of Code";
   addChild(myText);

   
  }
 }
}

```

When i put the same code into the actual timeline, it works fine. What could be wrong? No compile errors.

Thanks!
