开发者

Percentage loading bar for a SWF file through JavaScript

开发者 https://www.devze.com 2023-02-01 01:52 出处:网络
I have jsp that is suppose to load the .swf file which is large in size which takes of about 7 sec to load completely, could I hide the loading and put the J开发者_如何学编程avaScript percentage loadi

I have jsp that is suppose to load the .swf file which is large in size which takes of about 7 sec to load completely, could I hide the loading and put the J开发者_如何学编程avaScript percentage loading bar for Swf file.


As far as I know, you can't build a proper progress bar for a single file in JavaScript. Progress bars for web sites usually monitor load completion for multiple images to fake having access to the actual percentage of a page being loaded (if 1 out of 10 images is loaded, that's 10 percent, right?).

Alternatively, you could show an animated GIF, something like a spinning wheel or something else that moves and is not directly related to the size of the file being loaded. You would then add a listener to the page's onLoad event, and hide the GIF when it's fired.

...or you can still have a nice progress bar, if you don't do it in JavaScript: Try reorganizing your Flash file instead! Here is a tutorial on preloading a single SWF file.

0

精彩评论

暂无评论...
验证码 换一张
取 消