<div>Hello,</div>
<div>&nbsp;</div>
<div>That code is incomplete, and has a typo: call-back should be call_back (- isn't allowed in a variable name).</div>
<div>I've seen the&nbsp;the page&nbsp;from which this script comes. Sorry, but I don't remember the address.</div>
<div>You need the ImagePreloader.prototype.XXXXX functions too,</div>
<div>I suggest you look at the source&nbsp;of the&nbsp;example page provided on that site if you have the address.</div>
<div>It has the complete working&nbsp;code in it.<br>&nbsp;</div>
<div>\Henrik</div>
<div><span class="gmail_quote">2006/6/19, suresh kumar &lt;<a href="mailto:asureshkumar_1983@yahoo.co.in">asureshkumar_1983@yahoo.co.in</a>&gt;:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>
<div><span lang="EN-GB">function ImagePreloader(images, call-back)</span></div>
<div><span lang="EN-GB">{</span></div>
<div><span lang="EN-GB"><span>&nbsp;&nbsp; </span>// store the call-back</span></div>
<div><span lang="EN-GB"><span>&nbsp;&nbsp; </span>this.call-back = call-back;</span></div>
<div><span lang="EN-GB">&nbsp;</span></div>
<div><span lang="EN-GB"><span>&nbsp;&nbsp; </span>// initialize internal state.</span></div>
<div><span lang="EN-GB"><span>&nbsp;&nbsp; </span>this.nLoaded = 0;</span></div>
<div><span lang="EN-GB"><span>&nbsp;&nbsp; </span>this.nProcessed = 0;</span></div>
<div><span lang="EN-GB"><span>&nbsp;&nbsp; </span>this.aImages = new Array;</span></div>
<div><span lang="EN-GB">&nbsp;</span></div>
<div><span lang="EN-GB"><span>&nbsp;&nbsp; </span>// record the number of images.</span></div>
<div><span lang="EN-GB"><span>&nbsp;&nbsp; </span>this.nImages = images.length;</span></div>
<div><span lang="EN-GB">&nbsp;</span></div>
<div><span lang="EN-GB"><span>&nbsp;&nbsp; </span>// for each image, call preload()</span></div>
<div><span lang="EN-GB"><span>&nbsp;&nbsp; </span>for ( var i = 0; i &lt; images.length; i++ ) </span></div>
<div><span lang="EN-GB"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>this.preload(images[i]);</span></div>
<div><span lang="EN-GB">}</span></div>
<div><span lang="EN-GB">The call-back function is stored for later use, then each image URL is passed into the preload() method.</span></div>
<div><span lang="EN-GB">&nbsp;</span></div>
<div><span lang="EN-GB">ImagePreloader.prototype.preload = function(image)</span></div>
<div><span lang="EN-GB">{</span></div>
<div><span lang="EN-GB"><span>&nbsp;&nbsp; </span>// create new Image object and add to array</span></div>
<div><span lang="EN-GB"><span>&nbsp;&nbsp; </span>var oImage = new Image;</span></div>
<div><span lang="EN-GB"><span>&nbsp;&nbsp; </span>this.aImages.push(oImage);</span></div>
<div><span lang="EN-GB"><span>&nbsp;&nbsp; </span></span></div>
<div><span lang="EN-GB"><span>&nbsp;&nbsp; </span>// set up event handlers for the Image object</span></div>
<div><span lang="EN-GB"><span>&nbsp;&nbsp; </span>oImage.onload = ImagePreloader.prototype.onload;</span></div>
<div><span lang="EN-GB"><span>&nbsp;&nbsp; </span>oImage.onerror = ImagePreloader.prototype.onerror;</span></div>
<div><span lang="EN-GB"><span>&nbsp;&nbsp; </span>oImage.onabort = ImagePreloader.prototype.onabort;</span></div>
<div><span lang="EN-GB"><span>&nbsp;&nbsp; </span></span></div>
<div><span lang="EN-GB"><span>&nbsp;&nbsp; </span>// assign pointer back to this.</span></div>
<div><span lang="EN-GB"><span>&nbsp;&nbsp; </span>oImage.oImagePreloader = this;</span></div>
<div><span lang="EN-GB"><span>&nbsp;&nbsp; </span>oImage.bLoaded = false;</span></div>
<div><span lang="EN-GB"><span>&nbsp;&nbsp; </span></span></div>
<div><span lang="EN-GB"><span>&nbsp;&nbsp; </span>// assign the .src property of the Image object</span></div>
<div><span lang="EN-GB"><span>&nbsp;&nbsp; </span>oImage.src = image;</span></div>
<div><span lang="EN-GB">}</span></div>
<div><span lang="EN-GB"></span>&nbsp;</div>
<div><span lang="EN-GB"></span>&nbsp;</div>
<div><span lang="EN-GB">This code i downloaded from net for loading images in my project.I am displaying images in infinite loop untill i close the browser.But i want Particular images is to run for some specific no of times.How
 can i achieve this task.If any one having the code send me</span></div>
<div><span lang="EN-GB"></span>&nbsp;</div>
<div><span lang="EN-GB">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A.suresh</span></div></div>
<div><span class="ad">
<p>
<hr size="1">
Yahoo! India Answers: Share what you know. Learn something new <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://us.rd.yahoo.com/mail/in/mailanswersshare/*http://in.answers.yahoo.com/" target="_blank">
Click here</a><br>Send free SMS to your Friends on Mobile from your Yahoo! Messenger <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://us.rd.yahoo.com/mail/in/freesms/*http://messenger.yahoo.com/download.php" target="_blank">
Download now</a> 
<p></p></p></span></div><br>_______________________________________________<br>Javascript mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Javascript@LaTech.edu">Javascript@LaTech.edu
</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.latech.edu/mailman/listinfo/javascript" target="_blank">https://lists.LaTech.edu/mailman/listinfo/javascript</a><br><br><br></blockquote>
</div><br>