I was wondering if itās possible to use this script with .gif images? I can get it to work with .jpg images with names like wallpaper01.jpg and wallpaper02.jpg, but when I try to use .gif images it does not load anythingā¦
It would be much better with .gifās because I am getting the image distortion on alpha tween using .jpg imagesā¦
Thanks for the quick reply scotty, itās nice to see that you are still monitoring this thread! Nice thread 2, thanks for all the help youāve been giving everyone - youāre practically making everyoneās website that visits and uses this discussion!
When I use the original code youāve supplied without the alpha effect I have no problems with image distortion on my jpgās, however if do use the alpha effect then my images shift when they load into placeā¦ It looks bad when they do thatā¦
I will most likely be sticking with the original code when I decide to use this effect.
and the thread keeps goingā¦ for the life of me I canāt stop the image from flickeringā¦ it seems that on the first frame of the resize me functionā¦ everything evaluates to trueā¦ and makes my image 100% visibleā¦ then on consecutive passes, the itās false, resizes the border and displays my imageā¦ the flicker is acceptable on relatively the same size image, but on different ratios the flicker is REALLY apparentā¦ any ideas? hereās my code:
MovieClip.prototype.loadPic = function(pic) {
cur = pic;
this._alpha = 0;
this.loadMovie("images/db/body/"+imgLoc[pic]);
this._parent.onEnterFrame = function() {
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
if (t != 0 && Math.round(l/t) == 1 && containerMC._width>0 && containerMC._height>0) {
var w = containerMC._width+spacing, h = containerMC._height+spacing;
//everything below is to control the maximum image size
imgWidth = containerMC._width;
imgHeight = containerMC._height;
if (imgWidth<imgHeight) {
imgRatio = imgWidth/imgHeight;
containerMC._width = imageSize*imgRatio;
containerMC._height = imageSize;
} else if (imgWidth>imgHeight) {
imgRatio = imgHeight/imgWidth;
containerMC._width = imageSize;
containerMC._height = imageSize*imgRatio;
} else if (imgWidth == imgHeight) {
containerMC._width = imageSize;
containerMC._height = imageSize;
}
border.resizeMe(w, h, pic);
delete this._parent.onEnterFrame;
}
};
};
MovieClip.prototype.resizeMe = function(w, h, pic) {
var speed = 3;
this.onEnterFrame = function() {
containerMC._alpha = 0; // had to put this in to stop it from displaying straight off
this._width += (w-this._width)/speed;
this._height += (h-this._height)/speed;
//nav._x = Math.round(this._x-this._width/2); Don't use a nav bar
//nav._y = Math.round(this._y+this._height/2+spacing/2);
prevb._x = this._x-this._width/2-5;
nextb._x = this._x+this._width/2+5;
nextb._y = prevb._y=this._y-5;
imageText._y = this._y+this._height/2+5;
imageText._x = border._x-picinfo._width/2;
photo._y = this._y-this._height/2;
photo._x = this._x-this._width/2+5;
photo.photoID.text = imgPG[pic];//little drop shadow effect
photo.photoID1.text = imgPG[pic];//little drop shadow effect
imageText.text = imgCap[pic];
if (Math.abs(this._width-w)<1 && Math.abs(this._height-h)<1) {
this._width = w;
this._height = h;
containerMC._x = this._x-this._width/2+spacing/2;
containerMC._y = this._y-this._height/2+spacing/2;
containerMC._alpha = 100;
delete this.onEnterFrame;
}
};
};
EDIT: Anyone interested in my solutionā¦ I just got rid of the _parent in the first delete onEnterFrame. Donāt remove the first _parent, which creates the onEnterFrame, just in the ādeleteā donāt ask me why this works, but now everything is a-ok
Iām just trying to get a preloader to work in the V3withThumbs. Iāve tried every preloader listed in this thread and none of them work. Not one. Iād like to have the thumbs at 20% alpha while the full pic is loading, and then have the thumb turn 100% as the full size pics loadā¦ saw that effect in the artgallery_new2new2004.fla. But I canāt get that gallery to work.
So how do you get a preloaderā¦ any preloaderā¦ to work in the V3withThumbs gallery?
hello, iām try to use this gallery - does anyone know how to change the code, so there is a solid x position of the gallery (images are flushed to left side of the page)? thanks for any help!
Hi Scotty, please help!
Iām using the xml gallery fla from this thread . Fantastic!
here is my questionā¦
When I have thumbnails in 100s (say 200 to 300) , the script wait for all thumbnails to be loaded before I can click on the thumbnail to view the main image.
Is āASā not multi-threaded? Can I not view the slide image parallely when the thumbnail loading is in progress?
FYI: Thumbnail size average is 5 to 10KB and the slide image is around 100KB., I tested on m/c with 3GHz and 2GB ram.
Just from my initial tests, the xml gallery version posted in this thread (http://www.kirupa.com/forum/showthread.php?t=202132) does seem to allow load the main image when the thumbnail loading is in progress!
Any insight how this can be resolved? I donāt want the user to wait till all the thumbnails are loaded.
Thank you very much!
S A R A
Off course itās possible:)
Chenge the loadButtons and nextButton function like below (and you can skip the acivateButtons function)
function loadButtons() {
//added next two lines
var but = th_nav["thmb"+tnNr];
but.id = tnNr;
var tbox = th_nav["thmb"+tnNr].box;
tbox.loadMovie(tArray[tnNr]);
temp = this.createEmptyMovieClip("tmp"+tnNr, 999);
temp.onEnterFrame = function() {
bt = tbox.getBytesTotal();
bl = tbox.getBytesLoaded();
var per = Math.round(((bl/bt)*100)/tArray.length);
bar._width = ((totPer+per)/100)*curwidth;
info.text = "loading thumbnail "+(tnNr+1)+" of "+tArray.length+" total";
if (bt == bl && bt>4) {
//set the onrelease actions here, so you can use each thumb that has loaded
but.onRelease = function() {
container.loadPic(pArray[this.id], iArray[this.id]);
disButtons2(this.id);
};
nextButton();
totPer += per;
delete this.onEnterFrame;
}
};
}
function nextButton() {
if (tnNr<tArray.length-1) {
tnNr++;
loadButtons();
if (tnNr == 1) {
//show the first pic if the second thumb gets loaded
th_nav.thmb0.onRelease();
}
} else {
mainButtons();
}
}
Scotty,
Fantastic! That worked. Thanks a lot.
If there is any issue with loading the thumb image, then the script stops. (when thumbnail image not found or when itās not in jpg format). Iāll add some delay logic to wait and see if it loads or else continue with the next thumbnail loading. Anyway, this is a homework for me
Im new here and was wondering if someone can look at my file for this auto resize image container. My file is too large to post here so can someone send me an email address and I can send the file there?