Tails
12-19-2002, 08:51 PM
I have a bunch of images with the names 20.gif through 2f.gif (following hex). I want them to all be preloaded in as short amount of script as possible. There's It's a nice trick to store variables in hex, but if you increment it through the FOR loop, or any other type of arithmetic, it converts it to base10. This isn't good. I had something more like this in mind:
N=0x20
for (i=N; i<0x30; i++)
{
"p"+i=new Image()
"p"+i.src="'i'.gif"
}
Of course I could use Arrays, etc, but in the long run, it wouldn't be much shorter than 16 lines of preload script. Loading time is afterall a priority when preloading. What's a good preloading script for this?
N=0x20
for (i=N; i<0x30; i++)
{
"p"+i=new Image()
"p"+i.src="'i'.gif"
}
Of course I could use Arrays, etc, but in the long run, it wouldn't be much shorter than 16 lines of preload script. Loading time is afterall a priority when preloading. What's a good preloading script for this?