Load pictures

Hi Experts,

I hope that You will respond me ASAP.

I have a script:

while (i>0) {
    _root.mcy.data.duplicateMovieClip("DCP_" + i, i, {_x:10, _y:i*100+325});      
      loadMovie("DCP_"+(i+1)+".jpg", "_root.mcy.DCP_"+(i+1)+".pic");
this script loads 20 diferent pictures into newly created movie clips.
I have 20 pictures maximum at the time but sometimes, I have just 5 or less.

I need a control which will stop the duplicating movie clip if there is no more pictures in the folder.

Thanks in advance
Who is Participating?
Do you have any server side language available?  VB.NET?  Etc?

The server needs to "tell" flash how many files there are.  Flash can't do that on it's own.

You need to have server side language available to get the total files.

If you have php available...

Change your html do name from whatever.html to whatever.php then put this at the very top of the page:

if ($handle = opendir('audio')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") $thefiles[] = $file;
$totalFiles = sizeof($theFiles);

Then in the object coding that embeds your swf add this param:
<param name="FlashVars" value="total=<?php echo($totalFiles); ?>" />

and in the <embed section add:
FlashVars="total=<?php echo($totalFiles); ?>"

Then in your actionscript:

Change i = 20; to i = total;

Oh!  In the first line of the php:

if ($handle = opendir('audio')) {

Change audio to the directory that your images are in.

Make sure permissions on the folder are set to 777

marko-expertAuthor Commented:
I do not have PHP support...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.