View Full Version : image load splash
mallchin
07-17-2006, 10:20 AM
Is there any way to have a splash whilst the images are loading? Perhaps the fancy circle with the clockwise moving hand that displays on the dashboard demo.
Note, these images are in a solo application and are being referenced dynamically, that is via http:// (not compiled in).
Thanks.
mallchin
07-18-2006, 07:18 AM
Bump
jks_pdx
07-20-2006, 08:40 AM
Try setting persistent='true' in your splash tag, adding an onload handler in the views that are loading images, set a counter with the number of images you are loading, at each "onload" event decrement the counter. When the counter goes to zero call canvas.splash.destroy();
mallchin
07-22-2006, 09:11 AM
Thanks, though it seems you can only use splash on the canvas?
I'm looking more for a simple method to display a loader graphic where the image should be whilst it is loading and replace it with the image when it's loading. Loading 10 images on the screen should show 10 loader graphics which change as the images are loading.
I'll try the onload event, it might throw up something.
jks_pdx
07-24-2006, 12:25 PM
Now I understand what you are trying to accomplish.
A nice animated wait indicator can be found at
http://svn.openlaszlo.org/openlaszlo/trunk/laszlo-explorer/assets/explore_loading.swf
It doesn't seem like you can have both a resource and a source on the same view.
What you could do is create two views. One is loading the image (loader), the other is for displaying the wait indicator (waiter). Once you get an onload event for the loader view, you can destroy the waiter view. Note that these two views should be siblings, not parent child, because if loader is a child of waiter, then you can't destroy waiter, without destorying loader too. On the other hand, if waiter is a child of loader, then it won't display until loader is done loading, which defeats the whole purpose.
mallchin
07-24-2006, 12:33 PM
Good idea.
I was thinking something along the same lines -- a quick/simple loader graphic replaced by the image once it has loaded.
I agree the siblings method would work best, swapping the visible image based on an onload event for the proper image. Thanks for the suggestion, I'll try it later and see how it goes :)
BTW, the loader graphic (above) is the exact one I was after ;)
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.