PDA

View Full Version : Preloading images with VBS


ShADoWFLaRe85
April 8th, 2002, 05:18
Okay, I really can't figure out how to do this decently. Anybody out there familiar with VBScript?
I've checked out some sites and I only found one site with even one idea on how to do it. The site suggested to use 2 regular IMG tag, yet use a style attribute to change the visibility of the preloading one to hidden. Then, when the time came, you were supposed to swap the src attribute of the hidden image over to the displayed image.
I find this to be very cumbersome. Anybody got any better ideas? I've though of a variation of the above idea. Using a for loop, I could probably cycle through an array of src values that I want to preload, which should put them into memory one by one. I also found something about a LoadPicture() procedure, however, it doesn't seem to want to function properly. It gives me errors about not being able to find the supplied path no matter what I pass to it. Well, it did give me "Permissions Denied" when I tested it with an absolute local path. The documentation states that it returns an image object. I wasn't even aware that you could setup image objects in vbs. What?
Dim imgImage as Image :confused:
How would I even declare that?
This is just becoming frustrating. Any help would be appreciated.