Topic awaiting preservation: Preloading an array with onload= (Page 1 of 1) |
|
---|---|
Neurotic (0) Inmate Newly admitted From: |
posted 08-03-2004 16:19
I'm having trouble with preloading an array with image objects in it. |
Nervous Wreck (II) Inmate From: London |
posted 08-04-2004 00:01
You have two body tags - try removing one of them and seeing if it still fails. |
Obsessive-Compulsive (I) Inmate From: |
posted 08-04-2004 10:30
no, that was just a stupid misstake when copy-pasting. |
Nervous Wreck (II) Inmate From: London |
posted 08-04-2004 11:23
What was it? The missing () after "new Image"? |
Obsessive-Compulsive (I) Inmate From: |
posted 08-06-2004 13:27
No, I had to initialize the arrays outside preload(). Otherwise change_image() won't be able to acsess them. It seems like this solution only works for IE. |
Nervous Wreck (II) Inmate From: London |
posted 08-06-2004 17:17
quote:
code: var pics=new Array("k1.jpg", "k2.jpg", "k3.jpg", "k4.jpg");
code: var pics=['k1.jpg', 'k2.jpg', 'k3.jpg', 'k4.jpg'];
|
Paranoid (IV) Inmate From: USA |
posted 08-06-2004 19:04
new Array() should be just as valid as []. |
Maniac (V) Mad Scientist From: Somewhere over the rainbow |
posted 08-06-2004 23:01
The poster has demanded we remove all his contributions, less he takes legal action. |
Nervous Wreck (II) Inmate From: London |
posted 08-07-2004 11:21
quote:
code: var pics=new Array("k1.jpg", "k2.jpg", "k3.jpg", "k4.jpg");
code: var myArray=new Array(10);
|
Maniac (V) Mad Scientist From: Somewhere over the rainbow |
posted 08-07-2004 12:22
The poster has demanded we remove all his contributions, less he takes legal action. |