Help with create text field

Okay I’m really new to create text field. I am trying to make some text appear (obviously) so I decided to create an object that would execute it and then I could place the text. What’s wrong with it?


attachText = function(textName, depth, x, y, newWidth, newHeight)	{
	this.textName = textName;
	this.depth = depth;
	this.x = x;
	this.y = y;
	this.newWidth = newWidth;
	this.newHeight = newHeight;
	
	this.textClip = _root.createTextField(this.textName, this.depth, this.x, this.y, this.newWidth, this.newHeight);
};

this.attackText = new attachText("hitAmntText", 150, this.attackWho.clip._x, this.attackWho.clip._y-50, 200, 100);

this.attackText.textClip.text = this.hitAmnt;

I am also new to OOP so go easy if it’s way off :smiley: Any help, greatly appreciated! thanks