- Home
- Tutorials
- Flash
- Intermediate
- Flash MX Object Oriented Menu using PHP
Flash MX Object Oriented Menu using PHP
This article has been added to your 'Articles to Read' list.

PART7 - PHP - The PHP Script
Ashley McCoy
This user is yet to take control of their account and provide a biography. If you are the author of this article, please contact us via support AT actionscript DOT org.
View all articles by Ashley McCoyThe comments (// just like ActionScript) explain what is happening. There are plenty of good sites about PHP, to look up some of the functions used here go to PHP.net http://www.php.net/docs.php
<?php
$fileCount=0;// counter
// $myNum array is name in name=value pair
$myNum= array("one","two","three","four","five","six","seven","eight","nine","ten");
if ($dir = @opendir("../")) {// open directory
while (false !== ($file = readdir($dir))) { // loop through files
if ($file != "." && $file != "..") { // ignore . & ..directories
if(strstr($file,".html")){// only read files that end in .html
// build name=value pairs for flash from linkable files for menu
$valuesForFlash .="&".$myNum[$fileCount]."=".strtoupper(substr($file, 0, strpos($file, ".")));
$fileCount++;
}
}
}
closedir($dir);
}
// Output for Flash
$valuesForFlash.="&num=".$fileCount."&";
print $valuesForFlash;
?>

