I would like to 开发者_如何学Pythondisplay all images from a folder in a slideshow without having to specify every file name specifically using CS4 - AS3.
The SWF is running on the client machine and it cannot get a list of the contents of a folder at your server machine. Write a server side script that returns the list of files in the required folder in the appropriate format (json/xml/csv or whatever) and call that script from your SWF.
If you have control over the original filenames, you can do what I usually do: name them in some sort of numerical, consecutive order... image_01.jpg, image_02.jpg, image_03.jpg and so on.
Then, I use an image loader and create the expected filename programatically.
I trap the IOerrors and when I get a URL not found error, I know I have gone one too far.
Then you can wrap back around to the first image (image_01.jpg).
If you do not have the ability to create the names of your images and you are stuck with whatever filenames someone else gives you, then you would need Adobe Air to be able to access the files system of the local machine you code is running on....
Hope this helps.
精彩评论