yet another flash photoviewer

I can across Brajeshwar’s nice External JPEG file preloader and thought I’d make a few modifications to use it as a photoviewer to display a collection of images I wanted to share. Ideally I was hoping to be able to simply point it at a directory of jpegs and have it enumerate and then load them one by one. The auto-enumeration requirement however became a bit of a sticking point so I wound up just reading the jpeg count from a text file using loadVariables(). Of course it would also have been just as easy to cobble together a bit of php to do it dynamically on the swfs behalf. Thanks to a pointer from the wise folks on the flashnewbie list it appeared that it might be possible to use a loadVars() hack to achieve the file count as well. It was rumoured that loadVars() would allow me to check if a file existed without initiating a full download of the file so I could then just name my jpegs consecutively and loop until a mising file error on loadVars(). Unfortunately my tests seem to show that loadVars() loads the entire file even while only a portion winds up in the object.

Anyhow, see it in action here. The source is here.

Thanks Brajeshwar!

Leave a Reply