Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #15865
| 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 <bint@ign.com> |
| Newsgroups | comp.lang.javascript |
| Message-ID | <CC755413.C786%bint@ign.com> (permalink) |
| Thread-Topic | Good way to construct animation player? |
| Thread-Index | Ac2QiK8GU267+ZjLiUG3Fi1MnicEXg== |
| References | <CC74AF7C.C630%bint@ign.com> <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 |
Show key headers only | View raw
>> 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 :
> ======
>
> <div>
> <p><img name="viewer" src="album_01/100.png" alt="ecran"></p>
> <p><button id="but" onclick="player();">play</button>
> </div>
>
>
>
> But ... you can certainly find examples more sophisticated
> ... with fading for instance.
>
> <http://ygda.free.fr/fonduEnchaine2.htm>
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
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Good way to construct animation player? Bint <bint@ign.com> - 2012-09-11 09:06 -0500
Re: Good way to construct animation player? Martin Leese <please@see.Web.for.e-mail.INVALID> - 2012-09-11 08:38 -0600
Re: Good way to construct animation player? Bint <bint@ign.com> - 2012-09-11 10:41 -0500
Re: Good way to construct animation player? SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2012-09-12 03:38 +0200
Re: Good way to construct animation player? Bint <bint@ign.com> - 2012-09-11 20:48 -0500
Re: Good way to construct animation player? SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2012-09-12 12:26 +0200
csiph-web