Margin problems with createTextField

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?

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");
	};
}