help loading xml data in a loop
hola amigos, acudo a ustedes porque estoy haciendo una pequeña aplicación que muestre archivos para mi nueva zona de descargas, está hecha utilizando diagramación líquida(gracias por los tutoriales que encontré aquí)y los datos de los archivos los carga desde un archivo xml.
Tengo un movieclip cargado con addChild, y que a su vez dentro carga tambien con addChild varios paneles utilizando un loop, la cosa es que quise utilizar ese mismo loop para que cada vez que cree un panel, ya le cargue los datos xml, pero no puedo hacerlo, me sale el error 1009 diciendo que el objeto es nulo. acá les dejo parte del código, por si alguno de ustedes me puede ayudar con eso.
Por adelantado les agradesco.
Hello folks, I come to you because I am doing a small application that shows files for my new download zone, it is done using liquid layout and the information of the files its loaded them from a file xml.
I have a movieclip loaded with addChild, and inside loads also with addChild several panels using a loop, the thing is that I wanted to use the same loop in order to each time add a new pannel, also load the information from xml, but I cannot do it, every time show my an error 1009 saying that the object is null(void). Here I leave you part of the code them, for if someone of you can help me with it.
In advance thanks for the help, and here its a sample of the API: http://nesmothdesign.com/media/home.swf
// define XML parameter
var imgLoader:Loader;
var xml:XML;
var xmlList:XMLList;
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(new URLRequest("listado.xml"));
xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
function xmlLoaded(event:Event):void
{
xml = XML(event.target.data);
xmlList = xml.children();
trace(xmlList.length());
}
//add counter for the panns
var miContenedor:contenedor;
miContenedor = new contenedor();
addChild(miContenedor);
Tweener.addTween(miContenedor,{x:stage.stageWidth/2-465,time:1,transition:"easeIn"});
miContenedor.y = body_mc.y+10;
//add container´s children- -
var miPartA:panelTipoA;
var miPartB:panelTipoB;
for(var a:int=0;a<=3;a++)
{
miPartA = new panelTipoA();
miPartB = new panelTipoB();
miContenedor.addChild(miPartA);
miContenedor.addChild(miPartB);
miPartA.y = a * miPartA.height + (a*10);
miPartB.y = a * miPartB.height + (a*10);
miPartB.x = miPartB.width + 15;
imgLoader = new Loader();
imgLoader.load(new URLRequest(xmlList.attribute("thumb")));
miContenedor.miParteA.addChild(imgLoader);
}
Atention: the las 3 lines of code should add the data from xml to the respective pannel.
