Hi All,
I hope someone can help me out with this I am using a simple gallery to load external jpegs and everything works but I am trying to get the first one to load when it starts but with no success. I have added my as code which loads the images so hopefully one of the experts out there may be able to point me in the right direction.
imgbtn1.onRollOver = function() {
infoField._visible = true;
startLoading("1.jpg");
};
imgbtn2.onRollOver = function() {
infoField._visible = true;
startLoading("2.jpg");
};
imgbtn3.onRollOver = function() {
infoField._visible = true;
startLoading("3.jpg");
};
imgbtn4.onRollOver = function() {
infoField._visible = true;
startLoading("4.jpg");
};
imgbtn5.onRollOver = function() {
infoField._visible = true;
startLoading("5.jpg");
};
imgbtn6.onRollOver = function() {
infoField._visible = true;
startLoading("6.jpg");
};
imgbtn7.onRollOver = function() {
infoField._visible = true;
startLoading("7.jpg");
};
imgbtn8.onRollOver = function() {
infoField._visible = true;
startLoading("8.jpg");
};
imgbtn9.onRollOver = function() {
infoField._visible = true;
startLoading("9.jpg");
};
imgbtn10.onRollOver = function() {
infoField._visible = true;
startLoading("10.jpg");
};
function startLoading(whichImage) {
loadMovie(whichImage, "imageLoader");
_root.onEnterFrame = function() {
infoLoaded = imageLoader.getBytesLoaded();
infoTotal = imageLoader.getBytesTotal();
percentage = Math.floor(infoLoaded/infoTotal*100);
infoField.text = percentage+"%";
if (percentage>=100) {
delete this.onEnterFrame;
infoField._visible = false;
}
};
}