Hi can someone scan my code and see if there are any glaring mistakes
its ment to be a background preloader, so it loads stuff in,
but if the user selects something it stops, loads the choice item and removes it from the “to be loaded”…loadArray. so when it restarts it knows not to load it again
setback/feature 1: if a user choices to select an item, it will continue to load whatever is loading and start to load the item they want.
setback/feature 2: the preloader will not restart until the user calls userCont()… should I have a timer so after awhile it kicks back in?
**error: **just realised I have to stop it when it gets the end of the list.
stop();
//loadArray = stuff to load
//targetArray = target for stuff to load into
//
loader(loadArray, targetArray);
// call loader function
zuluCount = 0;
pauseVar =0
function loader() {
if (pauseVar == 0) {
MCL.loadClip(loadArray[zuluCount], targetArray[zuluCount]);
}
}
// manual override
function userLoad(img, tar,num) {
pauseVar = 1;
contains = function (tar, loadedArray) {
for (i=0; i<loadedArray.length; i++) {
//trace("PA"+zuluArray*);
if (loadedArray* == tar) {
return 1;
// found
}
for (j=0; j<loadedArray.length+1; j++) {
//viewer.image["i"+zuluArray[j]]._visible = false;
}
}
//test["i"+zuluArray*]._visible = false;
return -1;
};
if (contains(tar, loadedArray) == 1) {
//loaded already
//trace("Kirupa is found!");
tar._visible = true;
} else {
MCL.loadClip(loadArray[num], targetArray[num]);
for (i=0; i<loadArray.length; i++) {
if (loadArray* == tar) {
loadArray.splice(i, 1);
break;
}
}
}
}
function userCont(){
pauseVar =0
loader();
}
var myflickrMCL = new MovieClipLoader();
/*********************************************************************/
//callbacks
myflickrMCL.onLoadStart = function(targetMC) {
var loadProgress = myflickrMCL.getProgress(targetMC);
};
myflickrMCL.onLoadProgress = function(targetMC, loadedBytes, totalBytes) {
targetMC.bigPreview.load.preloadBar._xscale = loadedBytes/totalBytes*100
};
myflickrMCL.onLoadComplete = function(targetMC) {
trace("zuluLoad"+targetMC);
loadedArray[zuluCount] = targetMC;
zuluCount = zuluCount++;
if (pauseVar == 0) {
loader(loadArray, targetArray);
}
//;
var loadProgress = myflickrMCL.getProgress(targetMC);
};
myflickrMCL.onLoadInit = function(targetMC) {
};
myflickrMCL.onLoadError = function(targetMC, errorCode) {
};