473,888 Members | 1,528 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't seem to figure out how to get the ".complete" to return true or false...

65 New Member
Okay... so I'm generating a custom Slideshow tool for my friend... and I never seem to get any replies from Webberdev, so here I am, posting on a completely new forum...

Anyways, the code is here: http://moltx.name/index_code.php?f=....p&u=1183295841
The page is here: http://help.moltx.name/sites/darkvir...&image=sample2


I've turned off the images from showing... just in the functions "preloadIma ges" I can't seem to get document.preloa dProgressBar.co mplete or any of the other items with .complete at the end of them to return true or false... I've rearanged the code a ton, and still have gotten an error saying the code is null.
Jul 1 '07 #1
7 1668
Logician
210 New Member
I've turned off the images from showing... just in the functions "preloadIma ges" I can't seem to get document.preloa dProgressBar.co mplete or any of the other items with .complete at the end of them to return true or false... I've rearanged the code a ton, and still have gotten an error saying the code is null.
Have you checked that document.getEle mentById is actually returning a reference to an image?
Jul 1 '07 #2
moltendorf
65 New Member
(Can't believe that I got a response. =D)

It is returning a result, but my problem relies with preloading -this- part of the function:
Expand|Select|Wrap|Line Numbers
  1.         else if(this.preloaderLoading)
  2.             {
  3.                 var preloaderProgressBar;
  4.                 this.preloaderProgressBar = new Image();
  5.                 this.preloaderProgressBar.src = "./images/bar.png";
  6.                 document.preloaderProgressBar = new Image();
  7.                 document.preloaderProgressBar.src = this.preloaderProgressBar;
  8.                 var preloaderLeft;
  9.                 this.preloaderLeft = new Image();
  10.                 this.preloaderLeft.src = "./images/left.png";
  11.                 document.preloaderLeft = new Image();
  12.                 document.preloaderLeft.src = this.preloaderLeft;
  13.                 var preloaderRight;
  14.                 this.preloaderRight = new Image();
  15.                 this.preloaderRight.src = "./images/right.png";
  16.                 document.preloaderRight = new Image();
  17.                 document.preloaderRight.src = this.preloaderRight;
  18.                 var preloaderTop;
  19.                 this.preloaderTop = new Image();
  20.                 this.preloaderTop.src = "./images/top.png";
  21.                 document.preloaderTop = new Image();
  22.                 document.preloaderTop.src = this.preloaderTop;
  23.                 var preloaderBottom;
  24.                 this.preloaderBottom = new Image();
  25.                 this.preloaderBottom.src = "./images/bottom.png";
  26.                 document.preloaderBottom = new Image();
  27.                 document.preloaderBottom.src = this.preloaderBottom;
  28.                 var preloaderLoaded;
  29.                 this.preloaderLoaded = new Image();
  30.                 this.preloaderLoaded.src = "./images/loaded.png";
  31.                 document.preloaderLoaded = new Image();
  32.                 document.preloaderLoaded.src = this.preloaderLoaded;
  33.                 var preloaderUnLoaded;
  34.                 this.preloaderUnLoaded = new Image();
  35.                 this.preloaderUnLoaded.src = "./images/unloaded.png";
  36.                 document.preloaderUnLoaded = new Image();
  37.                 document.preloaderUnLoaded.src = this.preloaderUnLoaded;
  38.                 imagePreloader(false, this.id, false, false);
  39.             }
  40.         else
  41.             {
  42.                 if(document.preloaderProgressBar.readyState
  43.                 && document.preloaderLeft.readyState
  44.                 && document.preloaderRight.readyState
  45.                 && document.preloaderTop.readyState
  46.                 && document.preloaderBottom.readyState
  47.                 && document.preloaderLoaded.readyState
  48.                 && document.preloaderUnLoaded.readyState)
  49.                     {
  50.                         imagePreloader(true, this.id, false, false);
  51.                     }
  52.                 else
  53.                     {
  54.                         setTimeout("imagePreloader(false, "+this.id+", false, false);", 25);
  55.                     }
If you notice where it says readyState, I tried that instead of complete, but the thing is...

<body onload="initial ize();"> calls the initialize function.
The initialize function calls the imagePreloader function:
imagePreloader( false, window.currentI mageId, false, true);
The last true at the end makes this.preloaderL oading = true.
Which then sends it into that first part...
Then it calls itself again:
imagePreloader( false, this.id, false, false);
And since all conditions are false in the "if" statement, it goes to the last else.
The last else has an "if" statement in itself.
The if statement checks if all of the images preloaded it the else if statement in the first part of this code on this post... but the problem is... it gets stuck there, if someone could rework this code so that the:
Expand|Select|Wrap|Line Numbers
  1.                 if(document.preloaderProgressBar.readyState
  2.                 && document.preloaderLeft.readyState
  3.                 && document.preloaderRight.readyState
  4.                 && document.preloaderTop.readyState
  5.                 && document.preloaderBottom.readyState
  6.                 && document.preloaderLoaded.readyState
  7.                 && document.preloaderUnLoaded.readyState)
returns true... that would be one more step towards finishing this...
...because that's -where- it's stopping, not in the first part of imagePreloaded if statement, because that is skipped entirely.

BTW I added line numbers to the right of the code viewer on my site... if that helps some...
Jul 2 '07 #3
acoder
16,027 Recognized Expert Moderator MVP
Instead of using readyState, use the non-standard complete property.
Jul 12 '07 #5
moltendorf
65 New Member
.readyState and .complete aren't working atm.
=/
Jul 27 '07 #6
moltendorf
65 New Member
Figured out the issue to this like a year later!

I should be assigning the images I have an event (like I did in my ShinyLink program I just posted an issue I was having with about).

Expand|Select|Wrap|Line Numbers
  1. var image = new Image ();
  2. image.src = './image.jpg';
  3. image.onload = function ()
  4. {
  5. // What to do.
  6. }
I got a test script using this new knowledge at this location:
http://help.moltx.name/sites/darkvir...deshow_v2.php5
Aug 5 '08 #7
acoder
16,027 Recognized Expert Moderator MVP
Not sure why I didn't suggest that a year ago. Anyway, glad you've finally got it working and thanks for posting.
Aug 5 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

119
4664
by: rhat | last post by:
I heard that beta 2 now makes ASP.NET xhtml compliant. Can anyone shed some light on what this will change and it will break stuff as converting HTML to XHTML pages DO break things. see, http://www.alistapart.com/articles/betterliving/ I read on http://msdn.microsoft.com/netframework/default.aspx?pull=/library/en-us/dnnetdep/html/netfxcompat.asp It said they changed stuff like this
3
1318
by: ABC | last post by:
Which property or function can return the Page's URL in C#?
1
3397
by: Daniel | last post by:
is there any limit to how long of a string SqlDataReader.GetString() can return?
16
4214
by: saurabhnsit2001 | last post by:
The following program doesn't "seem" to print "hello-out". (Try executing it) #include <stdio.h> #include <unistd.h> int main() { while(1) { fprintf(stdout,"hello-out");
15
1262
by: Sunburned Surveyor | last post by:
I'm a Java developer in the process of writing a class library in C#, so please bear with me. I'm trying to write a method that can return a generic Object OR a Decimal value. In Java I would just have the method return an Object, since all Java primitive data types have Object wrappers like Integer and Double. If I have a method signature that returns Object in C#, can I return a Decimal value within the method body? I was looking...
2
1739
by: thomas | last post by:
#include<iostream> #include<vector> #include<map> #include<set> #include<iterator> #include<string> #include<algorithm> using namespace std;
0
10777
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10882
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9597
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7990
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7148
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6014
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4642
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4243
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3251
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.