Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

tuartboy

macrumors 6502a
Original poster
May 10, 2005
747
19
I don't do too much with flash so I need some input.

I am working on a site that needs to build galleries dynamically from images stored in various directories. I have been setting it up and started some implementation with prototype and scriptaculous, but I think it may just be pushing the JS envelope when a flash solution may work a lot better and save me time.

I need to have it embedded in the design, so no lightbox action. I also need to have thumbnails. Most importantly, I need a way to dynamically pass in the directory or a generated list of image files. I've seen some solutions that read an xml file and I could do that I guess, but I'd rather pass in the directory if possible.

Does anyone know of any solutions that might work?

Thanks a bunch.
 
The best way to do this (I reckon) is to use a combination of Flash, PHP and XML. Basically, you can write a PHP script that writes the results of a directory search into an XML file, which you can then load into Flash to populate the page with images. You can use PHP to create thumbnails too, and even read meta information from jpegs.

I've built several sites that load information directly from a PHP script into Flash, but to do it successfully you really need to use Flash MX 2004 or later, thus limiting your backward-compatibility (ie. it won't work in Flash Player 6 or earlier). Also the PHP I used is very basic and relies on very strict file names and directory structure. If anything is slightly wrong it won't work.

I'm currently working on a site that uses php to write an xml file, and then Flash just reads the xml. The advantages to this are that you can publish to earlier versions of Flash (5 and above I believe), and you can use PHP to pick up any problems before it writes the information into XML. You can also be a bit more random with your filenames since you don't necessarily need to number your files, for example.

I've got a great tutorial on this in a book, I'll see if there's an on-line version and come back to you with the link.

Hope this is some help.
 
I just went ahead and implemented it with prototype. All i have to do is ftp images into the directory and they load into the gallery resized and watermarked, so it's probably easier than flash anyway.

Thanks for the help though.
 
londonweb said:
I've got a great tutorial on this in a book, I'll see if there's an on-line version and come back to you with the link.

Hope this is some help.

what book, if you don't mind?

-thanks
 
camomac said:
what book, if you don't mind?

-thanks

Here's a link to it on amazon. The book's support site is www.flashsupport.com, but it doesn't seem to have all the tutorials on it, but the source code for them comes on a disk with the book, so that's what I've been basing my stuff on.
 
As an Amazon Associate, MacRumors earns a commission from qualifying purchases made through links in this post.
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.