Maybe I am a bit dense, but I have been trying to make this work all day and I
can't get it to, so I would kindly request some assistance.
Basically what I am trying to do is to read data from a database containing a
number of products and showing them on the stage.
Of course it is a work in progress and I have a lot of lines commented for
later implementations, still the problem I am facing here that the data loaded
in the first part of the code fails to show up later when I try to retrieve it
via the _root.datacontainer.items[j].xxx method. All I get is a number of
"undefined" on the screen.
Where am I going wrong? Any help is appreciated.

directory="public/";
lista=new LoadVars();
lista.load("http://www.agricolabaldi.com/tuttiProdotti.php");
lista.onLoad=function(success){
function carica(){
i = 0;
var totale=lista.t;
var elenco:Array=new Array();
for (i=0; i<(lista.t); i++){
elenco.push({
id:lista["id"+i],
nome:lista["nome"+i],
descrizione:lista["descrizione"+i],
nomeFoto:directory+lista["nomeFoto"+i],
novita:lista["novita"+i],
tipologia:lista["tipologia"+i],
confezionamento:lista["confezionamento"+i]
});
}
_root.datacontainer.dataProvider=elenco;
}
carica();
}
var thumbWidth:Number = 120;
var thumbHeight:Number = 75;
var MainTL:MovieClip = this;
var selected_thumb:MovieClip;
var thumbs:Array = new Array();
var thumbMCLoader:MovieClipLoader = new MovieClipLoader();
var listener:Object = new Object();
thumbMCLoader.addListener(listener);
initThumbScroller();

function initThumbScroller(targetBtn:MovieClip, workCategoryID:String){
var counter:Number = 0;
for(var j:Number=0;j<20;j++){
var thumb = MainTL.thumb.duplicateMovieClip("thumb"+counter,co unter);
thumb.thumb_title_mc._visible = false;
if (j==0){
xbase = 5;
ybase = 5;
thumb._x=xbase;
thumb._y=ybase;
} else {
if (xbase == 505){
xbase = 5;
ybase = ybase + 110;
thumb._x=xbase;
thumb._y=ybase;
} else {
xbase = xbase+ 125;
thumb._x=xbase;
thumb._y=ybase;
}
}

thumb.ID = counter;
thumb.title = _root.datacontainer.items[j].nome;
thumb.pictureURL = _root.datacontainer.items[j].nomeFoto;
counter++;

thumb.titleInitializing = true;
thumb.title_mc._visible = true;
thumb.title_mc._width = thumbWidth;
thumb.title_mc.theTitle.multiline = true;
thumb.title_mc.theTitle.wordWrap = true;
thumb.title_mc.theTitle.autoSize = true;
thumb.title_mc.theTitle.text = _root.datacontainer.items[j].nome;
thumb.title_mc._x =
0+Math.round((thumb.holder._width-thumb.title_mc._width)/2);

var thumbMCLoader:MovieClipLoader = new MovieClipLoader();
var listener:Object = new Object();
thumbMCLoader.addListener(listener);

thumbMCLoader.loadClip(_root.datacontainer.items[j].nomeFoto,thumb.holder.thum
b);

listener.onLoadComplete = function(target:MovieClip){
target._parent.preloader._visible = false;
}
listener.onLoadInit = function(target:MovieClip){
target._width = thumbWidth;
target._height = thumbHeight;

var tempMC =
target._parent._parent.createEmptyMovieClip("tempS wapMC",target._parent._parent.
getNextHighestDepth());
target._parent._parent.title_mc.swapDepths(tempMC) ;
}

thumb.holder.onRollOver = Delegate.create(MainTL,onThumbnailOver,thumb);
thumb.holder.onRollOut = thumb.holder.onDragOut =
Delegate.create(MainTL,onThumbnailOut,thumb);
thumb.holder.onRelease = Delegate.create(MainTL,onThumbnailClick,thumb);

thumbs.push(thumb);
}
MainTL.thumb._visible = false;
}

function onThumbnailOver(thumb:MovieClip){
setSelectedThumb(thumb);
}

function onThumbnailClick(thumb:MovieClip){
// if( site_xml.firstChild.childNodes[thumb.ID].attributes.link != undefined ){
// _global.mcwidth =
site_xml.firstChild.childNodes[thumb.ID].attributes.mcwidth;
// _global.mcheight =
site_xml.firstChild.childNodes[thumb.ID].attributes.mcheight;
// _global.picname = site_xml.firstChild.childNodes[thumb.ID].attributes.link;
// win = PopUpManager.createPopUp(_root, Window, true, {closeButton:true});
// win.title=" Azienda Agricola Baldi Paolo";
// win.contentPath=('showpic.swf');
// win.setSize(mcwidth,mcheight);
// var alto:Number = ((Stage.width-mcwidth)/2);
// var destra:Number = ((Stage.height-mcheight)/2);
// win._x = alto;
// win._y = destra;
// lo = new Object();
// lo.click = function(){
// win.deletePopUp();
// }
// win.addEventListener("click", lo)
// }
}

function setSelectedThumb(thumb:MovieClip):Void{
selected_thumb = thumb;
}
function getSelectedThumb():MovieClip{
return selected_thumb;
}