all groups > flash (macromedia) > november 2005 >
You're in the

flash (macromedia)

group:

PHP gallery and Flash



PHP gallery and Flash FayeC
11/24/2005 8:09:41 PM
flash (macromedia): Is there a way to have users login and have a gallery in Flash
populated with images associated with the user?
But that would not be using a database at all......
Like..
Let's say I create a folder in my images folder called user1.
User1 would then login using his username "user1" and then all the
images inside the folder with the same name as the username would be
pulled out and populated into the Flash movie.....
Is this easily or possible to be done?
Thank you for any advice, tip, help,

Re: PHP gallery and Flash Lomacar
11/25/2005 9:21:27 AM
Ya, I've just built something like it. As your thread title suggests, you can
use a PHP file to list files in a directory, within the PHP file you can sort,
filter, etc.the files and then echo something like
images=user1_a.jpg,user1_b.jpg,user1_c.jpg. This is then ready for import via
loadVariables or LoadVars (I don't get the difference between those but I'm
using LoadVars). So in Flash my code is

var crap = new LoadVars();
crap.onLoad = function():Void{
_root.images = this.images.split(',');
}
crap.load("NAME OF PHP FILE");

NAME OF PHP FILE is where you would obviously put the name the php file that
produces your file list. Notice that once the variables are loaded I split
images, which currently equals something like
"user1_a.jpg,user1_b.jpg,user1_c.jpg", on the commas, thus making an array with
the filename of each image. From there you can do whatever else it takes to
display those images using loadMovie(images[x]).
AddThis Social Bookmark Button