Auto playing gallery

I want to create a gallery similar to this but have the images load and play automatically. I looked at the code and figured instead of the “forward” and “backward” comands I could load them from a folder. Any ideas?

http://www.kirupa.com/developer/mx2004/xml_flash_photogallery.htm