# Help! Error with createTextField

**URL:** <https://forum.kirupa.com/t/help-error-with-createtextfield/73317>\
**Category:** Uncategorized\
**Created:** [December 15, 2004, 7:28am UTC](https://forum.kirupa.com/t/help-error-with-createtextfield/73317 "2004-12-15T07:28:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![neeko](https://avatars.discourse-cdn.com/v4/letter/n/439d5e/32.png) [@neeko](https://forum.kirupa.com/u/neeko)\
**Post date:** [December 15, 2004, 7:28am UTC](https://forum.kirupa.com/t/help-error-with-createtextfield/73317/1 "2004-12-15T07:28:14Z")

</div>

the following code is making me just about rip my hair out!!

im trying to create an object to create an Empty movie clip on the stage, and insert a textfield with certain param’s.

It works outside of the function scope, but when inside it crashes. Help!

```auto

function Label(labelText:String,num:Number,x:Number,y:Number,width:Number,height:Number){
 _root.createEmptyMovieClip("label_mc"+num,num);
 _root["label_mc"+num].createTextField("label",1,x,y,width,height);
 _root["label_mc"+num].label.text = labelText;
 _root["label_mc"+num].label.embedFonts = true;
 _root["label_mc"+num].label.textColor = 0xD7D7D7;
 _root["label_mc"+num].label.selectable = false;
 fmtLabel = new TextFormat();
 fmtLabel.font = "Gulim";
 fmtLabel.size = 30;
 fmtLabel.bold = true;
 _root["label_mc"+num].label.setTextFormat(fmtLabel);
}
neekoLabel = new Label("CREATIVE",10,195,40,225,34);

```
