all groups > flash (macromedia) > june 2005 >
You're in the

flash (macromedia)

group:

Dynamic Image slide show...


Re: Dynamic Image slide show... Sam
6/6/2005 3:52:36 PM
flash (macromedia): [quoted text, click to view]

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 ;

?>


Re: Dynamic Image slide show... Sam
6/6/2005 3:57:34 PM
[quoted text, click to view]

forgot to add, with this, you don't need to worry about the names of the
files. It reads them fresh each time. you can have any number of images
and any names you like. just drop them in or pull them out at your whim.

Dynamic Image slide show... JillMac58
6/6/2005 10:05:23 PM
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
Re: Dynamic Image slide show... Sam
6/7/2005 9:27:31 AM
[quoted text, click to view]

just take everything in from <?php and ?> (inclusive) and put that in a
text file and call it something like images.php then put it in the
folder just below where you store your images. for instance:

http://www.fakesite.com/slideshow/myimages/

put the flash slideshow and the php file in the slideshow folder, put
your images in the myimages folder and the only thing you need to change
is the name in quotes below in the php file.

$dir = "myimages";//set this to the directory of the images

then inside your flash you would have a line like this:

pics = new LoadVars();
pics.load("http://www.fakesite.com/slideshow/images.php");

and you should have all the images as variables from image0.jpg to whatever.

Re: Dynamic Image slide show... JillMac58
6/7/2005 3:54:32 PM
Sam -

Wow! Thanks so much for your help. It looks a bit over my head but will give it a try. Thanks for replying so quickly!

:)

AddThis Social Bookmark Button