A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: dynamicly load unknown amount of images

  1. #1
    Junior Member
    Join Date
    Jun 2000
    Posts
    26
    if i want to dynamicly load images from a folder, but don´t know how many pictures there are in the folder and the names of the pictures are something i can´t control so when i load the images i don´t know the names. How do i achieve this?

  2. #2
    You can't do that with flash alone. However, you could list the files in the (sub)folder(s) with php, then load them into flash split them into (multi-dimensional)arrays and display them.
    You could do it dynamically, having the php run and send variables every time the movie is loaded, OR you could use the php to create a txt file with all the names and load the variables from there. For the second method, you have to run the script mannually to update your variables file every time you update your pictures. Both methods are good for creating thumbnailed galleries, however you should only use the first method if you don't have a lot of pictures. (i have a database of 18,000 pictures+thumbnails and it takes about 12 seconds to generate the huge variable file)
    And of course, if you don't plan to have any thumbnails, you would have to resize the pictures manually, which is not recommended if you want to put it on the internet.
    That was the easy part.
    The hard part is when you acctually work with the arrays and put them on pages, say 20 pics per page... (this is a real pain if you have a lot of folders and subfolders)

    Well that's how I make my galleries. I'm not sure how you would do it otherwise. I can't give you too much detail because it would be just a waste of time since you might not want to do it with php, or you want to do it a whole different way.

  3. #3
    Senior Member
    Join Date
    Nov 2000
    Posts
    316
    i would think php to an array sent to flash is the best idea also

  4. #4
    Junior Member
    Join Date
    Jun 2000
    Posts
    26

    solved :)

    Thanks for the help .
    I solvde it with .asp. The .aps file reads the img folder and then sends a variable containing a number of how many images there are in the folder.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center