Can I count no. of images in folder from flash?

Hi ! all

My query is related to loading images from folder. I have a folder outside. I have created a animation in flash, .

Now I want to load all the images one by one, but if there are 5 images then after the 5th images again 1st image should come.

I have done this thing also, but my doubt is what, how can i count that how many images are there in my folder.

Code on first frame

if (whichPic == 5) {
whichPic = 1;
}
whichPic = whichPic+1;
loadMovie(“images/flashimages/image”+whichPic+".jpg", “square”);

Code on the movieclip "square"

onClipEvent (load) {
_alpha = 0;
count=0;
}
onClipEvent (enterFrame) {
if (_alpha<=0)
{
count=0;
}
if (count==0){
_alpha += 3;
}

if (_alpha>=99)
{
count=1;
}
if (count==1)
{
_alpha -= 2;
}
}

I m attaching the source file also.

If possible give me the reply

I believe its possible using PHP or ASP with Flash.

i have tried using text file, in which i simply stored a value in a text file variable for the number of images in the folder,

then i try to loop my script as per the value of the text file, but i could not get the solution.

guys please help me in this …

Yea, you could use a textfile to store the number of images.

hey, but i m not able to read the value of the text file, can anyone give me the code for that.

This tutorial might help you.
http://www.kirupa.com/developer/mx/externaldata.htm

thanks for reply, but i have still not got the solution

what dont you understand?