Dynamic loaded jpegs question

ok…here’s one for you brainiacks

I can dynamically load jpgs
I can randomize the order of dynamically loaded jpgs

but…Is there anyway to dynamically count the number of images in an external folder?

ie: The app is a little picture viewer that stops advancing after the last image. But I have to let the app know how many images to display before stopping.
I can do it with an external txt file or XML, but I don’t want to do that. Clients are to lazy to learn.
So if I put 8 iamges in a folder one day, it works as described, and if I put in 10 more images the next it still works the same.
All without having to do anything at all except putting in more images in a folder.

Does that explain it clearly enough and does anyone know how to do this?

Thanks
David

Hi,

I would approach it from the other side:

Instead of trying to count the number of images in the folder I’d
would make make the default of maximum number images a hig number (999 for instance).

Now u just have to check the size(getBytesTotal) of the container MC or level u are loading the jpg into(give it a frame or so it has ‘time’ to start loading it) if it’s 0 do wathever happens at the end of your slide show.

Cheers

SHO

I don’t know about that, Eki. Are you sure that if a picture is in the cache it won’t screw up everything?

Concerning the question, I’d do it with PHP.

pom :asian:

Hi,

It won’t if the images names are numbered and accessed by an increasing variable made string added to the default name of the image (img1, img2, img3,…etc), will it?

Cheers

SHO

Ps.: alternatively use the “anti-cache” code found in Kirupa’s
tuts

Of course, but since it’s an image viewer, we can suppose that the user wants to go back at some point. And forcing the download once more would be wasting… :slight_smile:

It’s really not that hard to implement in PHP.

pom :asian:

Hi,

I guess it would…I don’t have a clue about PHP:x

Cheers

SHO

After reading your posts, it has been helping a little.
It’s starting to help me see things a little differently in ways to attack this issue.
And Yes, since it is an image viewer, the user needs the ability to move forwards as well as backwards.

But what if the server your running this app on doesn’t support PHP.
Currently the server I’m developing on, doesn’t support PHP.

Thanks again for all your advice!
David

Then you’re screwed I’m afraid. Unless you use a textfile that you have to fill.

ilyaslamasse

Could you tell me how to do it with PHP?

The client still want to persure this so I’m gonna try to make it happen.

I’d appreciate any help!

Thanks
David