all groups > flash (macromedia) > june 2004 >
You're in the

flash (macromedia)

group:

AS question: return the list of items in a folder?


AS question: return the list of items in a folder? seb
6/2/2004 10:06:04 PM
flash (macromedia):
Hi all
This is a very specific AS question (although it might HAVE to involve
some PHP?):

I'd like to implement a navigation system in flash, for a gallery.
The gallery loads external jpegs from a folder. Easy.
Now, I want flash to go look into a specific folder and list the jpegs
in that folder, such as:
1 2 3 4 5 6 7 8 9
where each number gets a getURL link to load the corresponding jpeg on
the stage.

The point is:
Once I'm done building this navigation system, my client can add as many
images they want in the folder, and my Flash movie will adapt to it.

Of course, jpegs in the folder will be systematically named, like:
image1.jpg, image2.jpg, image3.jpg etc...

To get an idea, take a look at:
http://annetteberrydesign.com/index1.html
and click on portfolio.
You'll see the list of numbers under the images. For now, this list is
NOT dynamically produced (I have to change it if my client ads an image
to the folder).

Thanks for any help, this would be immensely helpful!
Re: AS question: return the list of items in a fol seb
6/2/2004 10:44:58 PM
Yes it's the actual site. Thanks, glad you like it.

Good idea about the text file, but:
If the textfile simply loads in the textfield, how do I make the numbers
in the text file link to each jpeg?
In short, how do I put the getURL function to apply to each number,
within the textfile?

[quoted text, click to view]
Re: AS question: return the list of items in a fol abeall
6/3/2004 2:30:36 AM
Is that the actual site, or an example? If it's the actual site, nice job.

I'm not an expert developer, but this is a (crude) solution that keeps it
entirely client-manageable. There may be a way to do it as you described, but
this is how I'd approach it for a project like this:
make the number of JPGs explicitly set. In other words, make a simple TXT
file(which gets loaded into the parent movie swiftly) that defines how many of
each section there is. Then when the client adds a JPG, they also change the
TXT file to define 1 more in the appropriate section. You need only one TXT
file for the entire site, the client will just need to make sure they are
changing the right variable.

HTH
Re: AS question: return the list of items in a fol abeall
6/3/2004 10:35:54 PM
What I mean is this:
1)create a TXT file, and define variables in the TXT like this:
&identity=7&catalogs=7&packaging=8
NOTE: make sure there are no Returns after the number, or else it wont get
read properly
2) in flash, you can load these variables in with either loadMovieNum() or
loadMovie() I would use loadMovieNum to load into levelNum 0(_root)
3) now you can access these varianbles in Flash to generate the numbered
sequence, and you load JPGs same as you are already doing
AddThis Social Bookmark Button