how can i give a value to my variable depending on how many .jpg’s i have
in my pictures folder.
lets say I have 53 jpg’s in the pictures folder and I need myvariable=53,
and if i put the 54th in, flash should update this value on _root.onLoad or on
what ever.
I don’t believe flash can do this alone, I normally use a php script to list directory contents:
<?
// Open directory
$myDirectory = opendir("path o\directory");
// get each entry
while($entryName = readdir($myDirectory))
{
$dirArray[] = $entryName;
}
// close directory
closedir($myDirectory);
// count elements in array
$indexCount = (count($dirArray));
// return the amount of files in the directory to flash with :
print "&myVariable=" . urlencode($indexCount+1);
?>
Save that as listdirectory.php and use the following code in flash: