Preloader problem

hi,
i m developing a xml based image gallery. i wrote code for generating thumbnails using loader component.
its working fine locally. but when i upload it its taking long time to load thumbnails. so i want to add preloader to it.
i tried using progress bar component. but not working!!!

i tried following :

code for creating thumbnails :

[INDENT]for (var i:Number = 0; i < thumbs.firstChild.childNodes[0].childNodes.length; i++)
{
_root.emptymc_mc.scrollmc_mc.newmc_mc.createClassO bject(mx.controls.Loader, “clip” + i , i, {contentPath:
thumbs.firstChild.childNodes[0].childNodes*.childNodes[0].nodeValue, scaleContent: true, _width: 40, _height: 40, _xi*55), _y:5});

_root.emptymc_mc.my_pb._visible = true;
_root.emptymc_mc.my_pb.setProgress(i, imageslength);

_global.endpoint = i * 55;

}
[/INDENT]

but its directly showing 91% and not the progress.

please reply…please please help…

thanks a lot
jlackyashdya