# \[AS2\]XML and autosized text field issue

**URL:** <https://forum.kirupa.com/t/as2-xml-and-autosized-text-field-issue/255331>\
**Category:** flash\
**Created:** [March 21, 2008, 8:36am UTC](https://forum.kirupa.com/t/as2-xml-and-autosized-text-field-issue/255331 "2008-03-21T08:36:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhvh1134](https://avatars.discourse-cdn.com/v4/letter/j/258eb7/32.png) [@jhvh1134](https://forum.kirupa.com/u/jhvh1134)\
**Post date:** [March 21, 2008, 8:36am UTC](https://forum.kirupa.com/t/as2-xml-and-autosized-text-field-issue/255331/1 "2008-03-21T08:36:49Z")

</div>

Been butting my head against the wall on this one. Im making a news app that loads xml data and diplays the data onto 3 seperate textfields. The 3rd textfield has auto size set to true, so that the height of each instance of the attached movie is always going to be different from each other. I need to figure out how to get the height from each instance of the attached movie and use those numbers for the verticle tiling so that they dont run into each other.

heres what I got so far. Its the “duke news” box. If you scroll down in the news box, you will see that the text starts running into each other.  
[www.dukedanger.com](http://www.dukedanger.com)

and heres my code:

```auto

touringXML = new XML();
touringXML.ignoreWhite = true;
touringXML.load('news.xml');

_root.theBox.createEmptyMovieClip("newsBox", _root.getNextHighestDepth());
theBox._x = 20;
theBox._y = 20;
theBox.newsBox._y = 68;
theBox.setMask(myMask);

touringXML.onLoad = function(success){
	if(success){
		date = [];
		headline = [];
		contentX = [];
		totalShows = this.firstChild.childNodes.length;
		for (i=0; i<totalShows; i++) {
			date* = this.firstChild.childNodes*.firstChild.firstChild;
			contentX* = this.firstChild.childNodes*.firstChild.nextSibling.nextSibling.firstChild;
			headline* = this.firstChild.childNodes*.firstChild.nextSibling.firstChild;
			var doingIt = theBox.newsBox.attachMovie("contentBox", "placeX_" + i, theBox.newsBox.getNextHighestDepth());
			doingIt.dateX.text = date*;
			doingIt.headline.text = headline*;
			doingIt.contents.text = contentX*;
			doingItHeight = doingIt._height;
			doingIt._y = i*doingItHeight*3;
			
			doingIt.headline._width = 180;
			doingIt.contents._width = 180;
			doingIt.contents.multiline = true;
			doingIt.contents.wordWrap = true;
			doingIt.contents.autoSize = true;

		}
	} 
};

```

thanks alot
