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

**URL:** <https://forum.kirupa.com/t/can-i-count-no-of-images-in-folder-from-flash/101374>\
**Category:** Uncategorized\
**Created:** [February 9, 2004, 10:43am UTC](https://forum.kirupa.com/t/can-i-count-no-of-images-in-folder-from-flash/101374 "2004-02-09T10:43:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanjay2211](https://avatars.discourse-cdn.com/v4/letter/s/c4cdca/32.png) [@sanjay2211](https://forum.kirupa.com/u/sanjay2211)\
**Post date:** [February 9, 2004, 10:43am UTC](https://forum.kirupa.com/t/can-i-count-no-of-images-in-folder-from-flash/101374/1 "2004-02-09T10:43:56Z")

</div>

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
