flash (macromedia):
[quoted text, click to view] JillMac58 wrote:
> I haven't been able to find in the fourms what i'm looking to do. I would like
> to create a simple slide show movie where the images fade in and out of say 5
> total images (very simle i can totally handle that!). BUT what I need it to do
> is pull the images from an external .jpg folder so that in the future all i
> have to do is overwrite the old files with new ones - but keeping the names the
> same... I'm not super duper in action scripting... Any insight on how to
> accomplish this would be fabulous!
>
> Thanks in advance.
>
> jill
>
I would use a php file to read the contents of your directory, and then
output the name of the images in a flash friendly format. Then have the
flash import the variables from the php file.
something like this for the php:
<?php
function dirList ($directory)
{
// create an array to hold directory list
$results = array();
// create a handler for the directory
$handler = opendir($directory);
// keep going until all files in directory have been read
while ($file = readdir($handler)) {
// if $file isn't this directory or its parent,
// add it to the results array
if ($file != '.' && $file != '..' )
$results[] = $file;
}
// tidy up: close the handler
closedir($handler);
// done!
return $results;
}
$dir = "images";//set this to the directory of the images
$results = dirList($dir);
$vars = "";
for($i=0;$i<count($results);$i++){
$vars .= "image" . $i . "=" . $results[$i] . "&" ;
}
echo $vars ;
?>