# Spacing dynamic text widths

**URL:** https://forum.kirupa.com/t/spacing-dynamic-text-widths/250984
**Category:** Uncategorized
**Created:** [February 4, 2008, 10:54am UTC](https://forum.kirupa.com/t/spacing-dynamic-text-widths/250984 "2008-02-04T10:54:12Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![modulater](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@modulater](https://forum.kirupa.com/u/modulater)
#### Post date: [February 4, 2008, 10:54am UTC](https://forum.kirupa.com/t/spacing-dynamic-text-widths/250984/1 "2008-02-04T10:54:12Z")

</div>

Hi there,

I would like to determine the exact spacing of the textfields for my xml file so I get a result for my horizontal nave like: home/ features/ work/ etc.

Now I have something like this:

GenerateMenu = function (container, name, x, y, depth, node\_xml) {  
var curr\_node;  
var curr\_item;  
var curr\_menu = \_root.container;

```
for (var i = 0; i&lt;node_xml.childNodes.length; i++) {
	curr_item = curr_menu.attachMovie("beh", "item"+i+"_mc", i);
	curr_item._x = x+i*spacing;
	curr_item.i = i;
	curr_item._y = y;

```

//beh(export name) is the movieclip attached to the mc container. In the mc with export name "beh’ I have a textfield with the name ‘name’.

This is what I tried to create the space with no result:  
container.beh.name.autoSize = true;  
spacing=container.beh.name.\_width +10;

Can someone help me out. Thx
