Skip to main content
Participating Frequently
January 26, 2009
Question

Load images from folder

  • January 26, 2009
  • 1 reply
  • 440 views
I havent used flash in a couple years and i'm feeling a little lost (not that i knew what i was doing before!) I am however determined and can understand the code, i just am a little overwhelmed.

I'd like to tell a movie clip to look into a specific folder (via url or whatever) and load all images from that folder into the movie clip. I do not want to have to give the movie the exact address of each image, as they files may change / be added to over time.

i know in AS3 i have to use the loader class and then the addChild to put the loaded stuff into the movie (and thats all i know), but i just dont know how to get all available images blindly. any help? please and thank you
This topic has been closed for replies.

1 reply

Inspiring
January 26, 2009
You have the right info for the Loader and addChild part.

But I'm afraid you can't use flash to request a directory listing on your server directly. You can have a script on your server return the directory listing to flash after the script performs a directory listing (e.g. php).

Other than that approach (using serverside scripting)...
You could have all the images with a common naming convention and a numeric suffix and just keep loading in turn until you encounter a loading error (which your code is set up to detect).....
e.g. image1.jpg, image2,jpg etc
or:

You could set up some manually coded xml to point to the urls of each image etc. It seems you want to avoid this though. (This is pretty much the same idea as the server side scripting except that instead of using scripting you create the data by 'hand' as xml).