Hi!
I have a document with two listboxes, one called "lista_firenze" and the other
called "lista_toscana". The "lista_toscana" has no problem, the other remain
empty, and everytime I try to populate it with an additemat I receive the
following error: "Cannot add an item past the end of the DataProvider". The
listboxes are absolutely identical, I duplicated one on the other, just
renaming its istance.
Could you help me, please? ...

Here is the code:



lista_toscana.color = 0xFFFFFF;
lista_toscana.fontFamily = "TradeGothic CondEighteen";
lista_toscana.fontSize = 14;
lista_toscana.backgroundColor = 0x3D635B;
lista_toscana.borderStyle = "none";
lista_toscana.selectionColor = 0x3D635B;
lista_toscana.textSelectedColor = 0xFFFFFF;
lista_toscana.useRollOver = false;
lista_toscana.scrollTrack = 0x29534A;

lista_firenze.color = 0xFFFFFF;
// .... and so on, same properties of "lista_toscana"

dati_xml = new XML();
dati_xml.ignoreWhite = true;
dati_xml.path = this;
dati_xml.load("XML/file.xml");
function xmlOnLoad() {
if (dati_xml.loaded) {
_root.xml_loaded = true;
var nodes = this.childNodes;
for (var j = 0; j<nodes.length; j++) {
if (nodes[j].nodeName == "mostre") {
mostre = nodes[j].childNodes;
for (var i = 0; i<mostre.length; i++) {
evento = mostre[i].childNodes;
for (var k = 0; k<evento.length; k++) {
if (evento[k].nodeName == "EV-IdEvento") {
IDEvento = evento[k].childNodes[0].nodeValue;
}
if (evento[k].nodeName == "SE-CAP") {
cap = Number(evento[k].childNodes[0].nodeValue);
label=EVTitolo+"\n"+EVNomeSede+"\n"+EVDataInizio+"
- "+EVDataFine;
if (cap > 50100 && cap < 50999) {
this.path.lista_firenze.addItemAt(i, label,
{data:IDEvento});
}
if (cap > 50000 && cap < 59999) {
this.path.lista_toscana.addItemAt(i, label,
{data:IDEvento});
}
}
}
}
}
}
lista_firenze.sortItemsBy("label", "ASC");
lista_toscana.sortItemsBy("label", "ASC");
}
};
dati_xml.onLoad = xmlOnLoad;