Flash XML menu with PHP
This example uses a php script to generate an XML list of images. Using
this script there is no need to update the XML file instead this file
is generated by php and returned to Flash. Adding a new image to the
folder should add a new menu item to the Flash movie with no more work
on your part.
This example leaves out the description text for each image. Since the file list is generated on the fly there is no where to store the description text. Though it could be done by creating new text files. I think if you needed descrption text it would be better to work with a pre written XML file as in the XML_menu_03 example.
Overview
When this file opens it uses loadVars to call on the file list_files.php,
this file takes one parameter named path which should be sent via the
GET method, list_files.php then returns a list of all of the files in
that directory.
The returned files come back in XML format, looking like this:
<menu> <item url='file_name'>file_name</item> ... </menu>
Notes
Note that the same value is returned as the url attribute of the item tag and
as the text value of the item tag (that is the text between the <item> and </item>
tags).
list_files.php only returns file names. It does not return the whole path. You will have include the path in front of the file name when you extract the file name from the XML.
list_file.php ignores directories and does not return these. You could modify the php script to do this without too much trouble if needed.
Here's a link to the source files. The images are not included. You will need to point the script to a directory of images. Also, the list_files.php file will NOT work from your desktop, it must be run from your php enabled server.
Source Files