Dominic M
02-21-2010, 03:38 PM
Hey guys
I got a problem. Iam new here so i hope i posted this in the right section.
Iam trying to make a little gallery using tumbnails. I made a script for preloading my big images. This works great but i cant get my tumbnails te preload...
function startLoadingTumb(image) {
loadMovie(image, wichTumb);
infoLoaded = wichTumb.getBytesLoaded();
trace (infoLoaded);
infoTotal = wichTumb.getBytesTotal();
trace (infoTotal);
percentage = Math.floor(infoLoaded/infoTotal*100);
main.infoField.text = percentage+"%";
if (percentage>=100) {
delete this.onEnterFrame;
main.infoField._visible = false;
}
};
I got like 20 images, so i want 1 function to call for every tumb. I call this function in the movie container on a seperate action layer.
_global.wichTumb = _target;
this._parent._parent._parent.startLoadingTumb(imag e);
The image variable is set on the Container it self with an
onClipEvent (load) {
_global.image = "images/tumb01.jpg";
this._width = 80;
this._height = 50;
}
The images load perfectly but when i use trace i get the message "undefined". My preloader text doesnt appear and iam pulling all my hair out.
I am pretty new at this and still learning alot. But this is hard for a new guy. Can some one send me in the right direction.
Tnx alot (using AS2)
I got a problem. Iam new here so i hope i posted this in the right section.
Iam trying to make a little gallery using tumbnails. I made a script for preloading my big images. This works great but i cant get my tumbnails te preload...
function startLoadingTumb(image) {
loadMovie(image, wichTumb);
infoLoaded = wichTumb.getBytesLoaded();
trace (infoLoaded);
infoTotal = wichTumb.getBytesTotal();
trace (infoTotal);
percentage = Math.floor(infoLoaded/infoTotal*100);
main.infoField.text = percentage+"%";
if (percentage>=100) {
delete this.onEnterFrame;
main.infoField._visible = false;
}
};
I got like 20 images, so i want 1 function to call for every tumb. I call this function in the movie container on a seperate action layer.
_global.wichTumb = _target;
this._parent._parent._parent.startLoadingTumb(imag e);
The image variable is set on the Container it self with an
onClipEvent (load) {
_global.image = "images/tumb01.jpg";
this._width = 80;
this._height = 50;
}
The images load perfectly but when i use trace i get the message "undefined". My preloader text doesnt appear and iam pulling all my hair out.
I am pretty new at this and still learning alot. But this is hard for a new guy. Can some one send me in the right direction.
Tnx alot (using AS2)