Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.posted.grandecom!news.posted.grandecom.POSTED!not-for-mail NNTP-Posting-Date: Tue, 11 Sep 2012 20:48:22 -0500 User-Agent: Microsoft-Entourage/12.23.0.091001 Date: Tue, 11 Sep 2012 20:48:19 -0500 Subject: Re: Good way to construct animation player? From: Bint Newsgroups: comp.lang.javascript Message-ID: Thread-Topic: Good way to construct animation player? Thread-Index: Ac2QiK8GU267+ZjLiUG3Fi1MnicEXg== References: <504fe79f$0$23472$ba4acef3@reader.news.orange.fr> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit Lines: 50 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 66.90.167.232 X-Trace: sv3-5CMT4CB5OKq/QrQ3Kl3TPsrhx0RQKCJgs9uWqlvS4LBxE51+4QiMB79Tp+3NoGvBWuynkw4sDGFc4aH!4PlE7s+swZNDWJJ403+nr0hO8ZIREOCNB5UfrdRJGKyKrhDd2t3Ck/zL/0Lrhg== X-Complaints-To: abuse@grandecom.com X-DMCA-Complaints-To: abuse@grandecom.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2620 Xref: csiph.com comp.lang.javascript:15865 >> Hello, >> >> I have an animation gallery online -- the animations are represented as >> folders of sequentially numbered image frames (PNG files). I want to make a >> player for these, where the user can click on a thumbnail and it will play >> the frames in a loop. > > JS : > ==== > > var nb = 100, // how many images > f = 'album_01', // folder of these images > i, // the image to display > c = nb; // a counter > function player() { > if(i) document.images.viewer.src = i.src; > c++; > if(c >= nb) c=0; > i = new Image(); > i.onload = function(){ setTimeout('player()',2000);} > i.src = f + '/' + c + '.png'; > } > > > HTML : > ====== > >
>

ecran

>

>

> > > > But ... you can certainly find examples more sophisticated > ... with fading for instance. > > Thanks! -- this looks similar to what I used in the past. It worked as I recall, but once the total number of loaded images passed 5MB, it stopped. Do you know any way around that? Is there any way to dispose of the memory used for images I no longer plan to show? It seems to cache them all and not free the memory, and then it stops being able to load them around 5Mb. Bint