PDA

View Full Version : Ultimate Fade-In Slideshow: Cancel Preloading



WmIrvin
03-29-2006, 02:25 AM
Script: Ultimate Fade-In Slideshow v1.5, previously modified per instructions from John to include Captions

Reference Thread from "Absolutely" posted on 01-18-06 with final reply on 02-22-06; http://www.dynamicdrive.com/forums/showthread.php?t=7203&highlight=ultimate.

The question was asked how to NOT preload all images, but rather, how to load the next image while displaying another image. I have implemented the changes (4 lines of code added or changed), but can not get it to display. I get the following error message in FrontPage preview mode:

Error: 'this.postimages.1' is null or not an object

This error occurs at the first two lines of code added:

this.postimages[0].src=this.theimages[0][0] // PRELOAD FIRST IMAGE
WITHIN ARRAY

this.postimages[1].src=this.theimages[1][0] // PRELOAD SECOND IMAGE
WITHIN ARRAY

I have a short demo program (using small images on a basically blank page) at:
http://www.viennapres.org/index-fadein2.htm

Any help in resolving this would be greatly appreciated.

Thanks,

Bill

ddadmin
03-29-2006, 06:28 AM
The error is in the code:


for (p=0;p<theimages.length;p++){
this.postimages[p]=new Image()
this.postimages[0].src=this.theimages[0][0] // PRELOAD FIRST IMAGE WITHIN ARRAY
this.postimages[1].src=this.theimages[1][0] // PRELOAD SECOND IMAGE WITHIN ARRAY
}

It should actuallly be:


for (p=0;p<theimages.length;p++)
this.postimages[p]=new Image()
this.postimages[0].src=this.theimages[0][0] // PRELOAD FIRST IMAGE WITHIN ARRAY
this.postimages[1].src=this.theimages[1][0] // PRELOAD SECOND IMAGE WITHIN ARRAY

Notice the removal of the outer curly brackets. They are not supposed to be there, as is the case with the code I posted in the other thread.

WmIrvin
03-29-2006, 12:50 PM
:) :) :)
Thanks a bunch! Some day I hope to be able to figure out things like that myself, but I am still too much a novice to do it now. I really do appreciate your help!