for(var i:int = 0; i < blogXMLList.length(); i++) {
//Create a TextField for each node in the XML
txtFArr.push(new TextField());
txtFArr[i].x = textX;
txtFArr[i].y = textY;
txtFArr[i].width = 100;
txtFArr[i].height = 200;
textX += 100;
txtFArr[i].multiline = true;
txtFArr[i].wordWrap = true;
txtFArr[i].border = true;
addChild(txtFArr[i]);
//Load the correct file and load the funtion to place the text in the correct field
blogPostRequest = new URLRequest(blogXMLList[i].attribute("file"));
blogPostLoader = new URLLoader();
blogPostLoader.load(blogPostRequest);
blogPostLoader.addEventListener(Event.COMPLETE, loadTextIntoField(i));
}
function loadTextIntoField(numberToLoad:int):Function {
return function(event:Event):void {
txtFArr[numberToLoad].text = event.target.data;
}
}