# Margin problems with createTextField

**URL:** <https://forum.kirupa.com/t/margin-problems-with-createtextfield/86767>\
**Category:** Uncategorized\
**Created:** [April 15, 2005, 12:27pm UTC](https://forum.kirupa.com/t/margin-problems-with-createtextfield/86767 "2005-04-15T12:27:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![markP](https://avatars.discourse-cdn.com/v4/letter/m/b3f665/32.png) [@markP](https://forum.kirupa.com/u/markP)\
**Post date:** [April 15, 2005, 12:27pm UTC](https://forum.kirupa.com/t/margin-problems-with-createtextfield/86767/1 "2005-04-15T12:27:14Z")

</div>

In the code below I’m creating a text field with a left and right margin. It seems the left margin works but it only pushes the text outside the box and the right margin doesn’t work at all. Can anyone help me out with this?

```auto
function showLinks() {
	_root.createEmptyMovieClip("archive_btn", 999);
	archive_btn._x = 100;
	archive_btn._y = 100;
	archive_btn.createTextField("linkBox", 1, 0, 0, 0, 0);
	archive_btn.linkBox.border = true;
	archive_btn.linkBox.borderColor = 0xFFFFFF;
	archive_btn.linkBox.background = true;
	archive_btn.linkBox.backgroundColor = 0x990000;
	archive_btn.linkBox.textColor = 0xFFFFFF;
	archive_btn.linkBox.selectable = false;
	archive_btn.linkBox.autoSize = 'left';
	archive_btn.linkBox.text = "Archive";
	myformat = new TextFormat();
	myformat.font = "Arial";
	myformat.leftMargin = 10;
	myformat.rightMargin = 10;
	archive_btn.linkBox.setTextFormat(myformat);
	//
	archive_btn.onRelease = function() {
		trace("press");
	};
}

```
