Problem displaying xml loaded data in flash

webmasterbeta

New Member
hi there
i really hope someone can help me...am desperate at this stage
I am displaying data in flash loaded from xml in the form of a "news title" then the "news brief", another "news title" then the "news brief" etc. Now I have managed to get all the news titles to be displayed one under the other. However, only the very last "news brief" is being displayed at the very end! Am really confused by this!! I have done trace actions to see the y values of the "news briefs" and they are incrementing sequentially. I have also traced out the txt of each news brief (4 in total)and I can see all four in the output screen!! So CONFUSED! I have attached a zip with the files if it is more helpful.

Below is the code

function processBook(xmlDoc_xml) {
allXML = xmlDoc_xml.firstChild.childNodes;
newsHeading = xmlDoc_xml.firstChild.attributes.heading;
numNews = allXML.length;
var mc:MovieClip;
for (var n = 0; n<numNews; n++) {
newsXML = new XML();
newsXML = allXML[n];
newsDetails = newsXML.childNodes;
newsLength = newsXML.childNodes.length;
trace("newsLength = "+newsLength);
for (i=0; i<newsLength; i++) {
yPos += 10;
pieceXML = new XML();
pieceXML = newsXML.childNodes;
node = pieceXML.nodeName.toLowerCase();
this["txt"+i] = pieceXML.firstChild.toString();
if (node == "title") {
mc = title_mc.duplicateMovieClip("title_mc"+n, n+1);
mc.title_txt.text = this["txt"+i];
mc._x = 0;
mc._y = yPos;
mc.theNum = n;
yPos = mc._y;
}
if (node == "brief") {
this.createTextField("news_brief"+i+"_txt", this.getNextHighestDepth(), 0, yPos+20, 135, 100);
this["news_brief"+i+"_txt"].autoSize = true;
this["news_brief"+i+"_txt"].multiline = true;
this["news_brief"+i+"_txt"].wordWrap = true;
this["news_brief"+i+"_txt"].selectable = false;
this["news_brief"+i+"_txt"].text = this["txt"+i];
trace("news brief txt="+this["news_brief"+i+"_txt"].text );
trace("news brief y value =http://www.webdeveloper.com/forum/archive/index.php/"+this["news_brief"+i+"_txt"]._y );
yPos= this["news_brief"+i+"_txt"]._y;
}
}
}

}
 
Back
Top