[FONT=Arial]ok I wrote a Photo album. This is the first time I’m working with such advanced script. Now that I have it working exactly the way I want it to, I realize that I didn’t preload any of the images. I would like to preload with a bar and numbers counting up in % for each thumbnail and the pic in the main container as well. They are all brought in the scene using the same function. Here is my code:
var filePath:String = "barbat/";
var clicks:Number = 0;
var picAmount:Number = 36;
var lastPage = picAmount-11;
function fadeIn() {
this.container._alpha = 0;
_root.onEnterFrame = function() {
container._alpha += 6;
if (container._alpha>99) {
container._alpha = 100;
delete _root.onEnterFrame;
}
};
}
function newPic(contName, picNum, xpos, ypos, picWidth, picHeight, type) {
var aNewPic = attachMovie("dummy", contName, this.getNextHighestDepth());
var picNum = picNum;
var fileName = filePath+"Picture"+picNum+".jpg";
var my_mcl = new MovieClipLoader();
var myListener = new Object();
myListener.onLoadInit = function(target_mc) {
target_mc._x = xpos;
target_mc._y = ypos;
target_mc._width = picWidth;
target_mc._height = picHeight;
if (type == 1) {
target_mc.onRelease = function() {
fadeIn();
loadMovie(fileName, "container");
};
} else if (type == 2) {
target_mc.onRollOver = function() {
//trace(this+" onRollOver called");
};
}
};
my_mcl.addListener(myListener);
my_mcl.loadClip(fileName, aNewPic);
}
function prevNext(instName:String, xpos:Number) {
attachMovie("invisbutt", instName, getNextHighestDepth());
this[instName]._x = xpos;
this[instName]._y = 400;
this[instName]._width = 50;
this[instName]._height = 50;
this[instName]._alpha = 50;
}
function page(startNum) {
var addNum:Number = startNum+12;
var subNum:Number = startNum-12;
newPic("thumb01", startNum, 249, 585, 70, 53, 1);
newPic("thumb02", startNum+1, 324, 585, 70, 53, 1);
newPic("thumb03", startNum+2, 399, 585, 70, 53, 1);
newPic("thumb04", startNum+3, 474, 585, 70, 53, 1);
newPic("thumb05", startNum+4, 549, 585, 70, 53, 1);
newPic("thumb06", startNum+5, 624, 585, 70, 53, 1);
newPic("thumb07", startNum+6, 249, 643, 70, 53, 1);
newPic("thumb08", startNum+7, 324, 643, 70, 53, 1);
newPic("thumb09", startNum+8, 399, 643, 70, 53, 1);
newPic("thumb10", startNum+9, 474, 643, 70, 53, 1);
newPic("thumb11", startNum+10, 549, 643, 70, 53, 1);
newPic("thumb12", startNum+11, 624, 643, 70, 53, 1);
newPic("container", startNum, 249, 178, 600, 400, 2);
prevNext("nextButt", 200);
this.nextButt.onRelease = function() {
if (startNum>=lastPage) {
} else {
page(addNum);
}
};
prevNext("prevButt", 50);
this.prevButt.onRelease = function() {
if (startNum<=1) {
} else {
page(subNum);
}
};
}
page(1);
If there is any help I can get on this it would greatly be appreciated.[/FONT]