"dynamic" picture gallery

hey guys

I checked out kirupa.com’s Picture Gallery tutorial which was cool.

Unfortunately it uses an array of specific images in a folder. How about searching for all JPG files in a particular folder, get the number of files and load these pictures.

Wishful Scenerio:
1- design a Flash Gallery.
2- write a backend script or two.
3- Upload the script and flash to server.
4- Take 10 pics today. Upload them to pics/ folder.

and the script tells Flash there are 10 images and Flash displays 10 thumbnails (or whatever).
The next day I may take 5 pictures. Upload 5 new pictures.
And the Flash file automatically knows there are 15 files in a folder.

So basically, I won’t be touching Flash or script for a long time. :smiley:

Any ideas, pointers, etc.?

cheers in advance. :slight_smile:

Well… Doesn’t sound that bad…

have server side script generate the text file everytime Flash asks to do the gallery thing…
Have your Flash movie read the text file that has certain format with the number of images and file names and such…

So… First step will be modifying Kirupa’s tutorial to read the text file and convert it to the array so that it will work the same way… Once that’s done, you can generate the server side script that will create the text file…

What do you think??? =)

now that is an idea, CyanBlue.

I will have to read up some info on generating a text file based on JPG files…

Any pointers or suggestions RE objects, class or whatever (keywords, etc.) so that I can search and find more about it.

thanks man.

reads all files in a folder and returns their details…:

<?php
$dir = opendir(".");
while($file = readdir($dir)){
if($file=="." or $file=="..") continue;
$dotposition = strrpos($file, ".");
$filename = substr($file, 0, $dotposition);
$extension = substr($file, 1 + $dotposition);
if($extension == "jpg" || $extension == "gif"){
$size = getImageSize($file);
echo "$filename.$extension   height = $size[1]  width = $size[0] <BR>";
}
}
?>
 

hehe that looks familiar eyez :slight_smile:

could’ve posted good ole “search” button again, but just had the php handy :smirk:

Yeah I do it too :slight_smile:

eyezberg,
cheers for the code – although it is PHP (I use ASP) but it should not be too difficult to “convert” your code to ASP.

With my limited knowledge of PHP, how does your code work? I don’t see a text file being saved (containing a list of these image files)…

I JUST made what you were talking about yesterday. Odd coiencidence, but here is my semi-finished version:

http://www.askthefool.com/apple

Still working on it, but currently its fully dynamic. I add pictures and run a C++ program which auto generates the thumbnails. Let me know what you think : )

Now i just have to get this swf, to be dynamic depending on the location I give it. I have tons of albums, and I don’t want to have to have seperate swf’s for each album or everytime I add a album.