Hello all,
I have a small problem with preloading images from a database.
Basically i have a folder on my server called ‘work’, i have a database in which when i add a new project a folder is created on the server in the folder ‘work’ and is labeled whatever the id number was of the project created eg. 1,2,3 etc.
In flash i have no problem loading the images into flash via the actionscript below:
var loader:MovieClipLoader = new MovieClipLoader();
for (i=0; i<=this["total_items"]; i++) {
loadingBar = _root.page_holder.thumbs["loadBar"+i];
Mask = _root.page_holder.thumbs["thumb"+i].mask;
mcImgHolder = _root.page_holder.thumbs["thumb"+i].image;
imgFilename = "work/"+this["id"+i]+"/preview.jpg";
loader.loadClip(imgFilename, mcImgHolder);
this.ref["id_"+i] = this["id"+i];
}
What i am after is when someone enters the page the images ‘preview.jpg’ are preloaded in sequence so for instance - thumb1 is loaded first, then when that is complete thumb2 is loaded etc.
I tried to add the following code, however this doesn’t do what i’m after.
var preload:Object = new Object();
loader.addListener(preload);
preload.onLoadStart = function(target) {
loadingBar._visible = true;
};
preload.onLoadProgress = function(target, loadedBytes, totalBytes) {
loadingBar._xscale = Math.round((loadedBytes/totalBytes)*100);
};
preload.onLoadComplete = function(target) {
Mask.slideTo(null, 0, 1, "easeOutQuad");
};
Does anyone know how to help?
Many thanks in advance