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
and heres my code:
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