Hello
I have a multi-sectioned XML driven presentation set up, but I cant figure out what the code would be for preloading each slide, Here is my code as it stands:
data_xml = new XML();
data_xml.ignoreWhite = true;
data_xml.load('data.xml');
data_xml.onLoad = function () {
mcMenu.thisis_btn.uv=0;
mcMenu.golden_btn.uv=1;
mcMenu.creative_btn.uv=2;
mcMenu.thisis_btn.onRelease = function () {
openGallery(this.uv);
mcMenu.tween("_y", inActiveX, .4, "easeoutcubic");
mcMenu.thisis_mc.stop();
}
mcMenu.golden_btn.onRelease = function () {
openGallery(this.uv);
mcMenu.tween("_y", inActiveX, .4, "easeoutcubic");
//mcMenu.golden_mc._alpha=0;
}
mcMenu.creative_btn.onRelease = function () {
openGallery(this.uv);
mcMenu.tween("_y", inActiveX, .4, "easeoutcubic");
//mcMenu.creative_mc._alpha=0;
//MAKE CHAPTERS
for (c=0; c<=30; c++) {
if (data_xml.firstChild.childNodes[c].hasChildNodes) {
trace (c);
//mcMenu.attachMovie('chapter', 'chapter'+c, c+100);
item = eval('mcMenu.chapter'+c);
item._x = -150;
item._y = -50 + c*100;
item.label_txt.text = data_xml.firstChild.childNodes[c].attributes.name;
item.uv = c;
};
};
};
//open initial gallery
//openGallery(0);
};
function openGallery(uv) {
createEmptyMovieClip('shell_mc', -100);
mcMenu.swapDepths(101);
prev_mc.swapDepths(99);
next_mc.swapDepths(100);
photos_array = [];
targets_array = [];
for(pic=0; pic<=100; pic++) {
if (data_xml.firstChild.childNodes[uv].childNodes[pic].attributes.location.length > 4) {
photos_array.push(data_xml.firstChild.childNodes[uv].attributes.folder+'/'+data_xml.firstChild.childNodes[uv].childNodes[pic].attributes.location);
shell_mc.attachMovie('photo', 'photo'+pic, pic+200);
photo = eval('shell_mc.photo'+pic);
photo._x = 0 //+ 550*pic;
photo._alpha = 100 - 100*pic;
targets_array.push('shell_mc.photo'+pic);
};
};
trace (photos_array.length + " photos found in this gallery");
//LOAD INITIAL PHOTO
justLoaded = 0;
my_mcl.loadClip(photos_array[justLoaded], targets_array[justLoaded]);
currentPic = 0
};
function loadPhoto(pic) {
if (pic == -1 || pic == photos_array.length) {
switch (pic) {
case -1:
trace ('no go');
break;
case photos_array.length:
trace ('end of show');
tableNav = true;
mcMenu.tween("_y", activeX, .4, "easeoutcubic");
mcMenu.back_btn._visible=true;
//break;
};
} else {
eval('shell_mc.photo'+currentPic).alphaTo(0, .4);
//shell_mc.tween('_x', pic*(-550), .7, "easeoutCubic");
currentPic = pic;
eval('shell_mc.photo'+currentPic).alphaTo(100, 1);
}
};
my_mcl = new MovieClipLoader();
listener = {};
my_mcl.addListener(listener);
listener.onLoadInit = function () {
justLoaded++;
my_mcl.loadClip(photos_array[justLoaded], targets_array[justLoaded]);
};
Can someone show me how i would set up a preloader for each slide, preferably one with just a progress bar?
i would be very grateful
thanks in advance!