|
-
Jul 25th, 2003, 11:11 AM
#1
Thread Starter
Frenzied Member
javascript 'control arrays', sort of
Hi,
I know there is a way to reference images on a webpage by combining the name + the number of the image, but I can't find out how.
For example, in my checker game animator, I have 64 images (sqr1, sqr2, sqr3, sqr4 etc), one for each square on the board. Since I'm using arrays to store the position of all of the pieces, it would be awesome if I could loop through the images and load the correct piece based on the value in the array
Something like
VB Code:
document.controls["sqr" + i].src = '.... bla bla bla
Although I'm sure that syntax is 100% incorrect.
Any ideas??
-
Jul 27th, 2003, 12:00 AM
#2
Lively Member
document.all["sqr"+1].src="blah.jpg"
if you choose not to decide you still have made a choice!
RUSH rocks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|