开发者

actionscript 3.0 load images dynamically

开发者 https://www.devze.com 2022-12-25 19:43 出处:网络
I am making a photo slideshow in flash and would like to be able to l开发者_如何学Coad images dynamically from a folder. So that whenever i have a new photo i can just stick it in a folder and have my

I am making a photo slideshow in flash and would like to be able to l开发者_如何学Coad images dynamically from a folder. So that whenever i have a new photo i can just stick it in a folder and have my swf file read from that folder and update the slideshow. Is this doable in actionscript 3.0? if so any pointers would be helpful. thanks!


Sounds like this would be more server-side logic than Flash logic.

Your Flash program would need to ask the server for a list of images to load (which the server script would get from directory). You would need to choose a data exchange format (plain text (e.g. one filename per line), or XML, or whatever is easiest for you to work with). The server script would send back the list in the chosen data format. Then your Flash program would load all the images in the list, and present them to the user in a slideshow.

The trickiest parts of your problem would be getting the list of images in the directory (depends on which language you're using server-side, but shouldn't be too difficult), and getting Flash to communicate with the server asynchronously (check out URLLoader).

0

精彩评论

暂无评论...
验证码 换一张
取 消