Please take a look at this. Trying to integrate preloader code to this loadMovie code. Not done properly obviously…but how to I do it?
square._alpha = 0;
whichPic = 1;
this.createEmptyMovieClip(“preloader”, 1000);
next.onPress = function() {
if (whichPic<5 && !fadeIn && !fadeOut) {
fadeOut = true;
whichpic++;
input = whichPic;
}
};
back.onPress = function() {
if (whichPic>1 && !fadeIn && !fadeOut) {
fadeOut = true;
whichpic–;
input = whichPic;
}
};
_root.onEnterFrame = function() {
// when a new Photo is selected, fade out, load new image, and fade in
if (square._alpha>10 && fadeOut) {
square._alpha -= 10;
}
if (square._alpha<10) {
loadMovie("…/images/image"+whichPic+".jpg", “square”);
square._visible = false;
fadeOut = false;
fadeIn = true;
}
preloader.onEnterFrame = function() {
var l = square.getBytesLoaded();
var t = square.getBytesTotal();
var getPercent = l/t;
loadText = Math.round(getPercent100)+"%";
loadBar._width = getPercent100;
if (l>0 && l>=t) {
square._visible = 1;
delete this.onEnterFrame;
}
};
if (square._alpha<100 && fadeIn && !fadeOut) {
square._alpha += 10;
} else {
fadeIn = false;
}
};