Fires of Heaven Guild Message Board  

Go Back   Fires of Heaven Guild Message Board > General forums > Development
User Name
Password
ForumSpy Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 04-03-2008, 06:00 PM   #1 (permalink)
Sabolin
Registered User
 
Join Date: May 2003
Posts: 215
-1 Internets
Javascript question

This might be a bit ambiguous but I can't get google to help me out at all on this one.

When my page loads, I initialize an array, lets call it 'theImages'. After the page loads, I run a function that loads 20 images into this array. I have an image object on the page that can loop through these images in order, with Next, Previous, and Animate buttons.

The load function runs once, and calls another function that loops through the array and checks if each file is finished downloading using something like
if(theImages[i].complete == true)
where i is an integer in a for loop from 1 to 20. The function then writes a percent complete line to another element on the page and then calls itself via setTimeout. When the images are finished loading, the setTimeout is no longer called.

While the images are loading, the next/previous/animate buttons work, the object just doesn't display any images that haven't loaded yet. Problem is, once I press any of those buttons, whether the requested image has loaded or not, the percent text shoots to 100% and claims that the loading is done, but the images continue loading in the background (and is evident by the "transferring data from..." status bar text).

My theory is that using something like this line,
document.getElementByID("main_image").src = theImages[next_image].src
causes the browser to assume that all images inside the array are complete for some reason. This is true for both IE7 and Firefox. I can't find anything on google to confirm this theory though, and can't find any solution or alternative for what I'm trying to do.

If anyone can help me with this it would be greatly appreciated.
Sabolin is offline   Reply With Quote
Old 04-04-2008, 09:33 AM   #2 (permalink)
Sabolin
Registered User
 
Join Date: May 2003
Posts: 215
-1 Internets
My theory was wrong, but I fixed it.

Ignore this thread
Sabolin is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On
uberguilds network



All times are GMT -7. The time now is 02:35 AM.


Powered by vBulletin® Version 3.6.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.0 RC6