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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 9, 2004, 11:18am UTC](https://forum.kirupa.com/t/can-i-count-no-of-images-in-folder-from-flash/42444/2 "2004-02-09T11:18:57Z")

</div>

I believe its possible using PHP or ASP with Flash.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 9, 2004, 11:36am UTC](https://forum.kirupa.com/t/can-i-count-no-of-images-in-folder-from-flash/42444/3 "2004-02-09T11:36:48Z")

</div>

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 …

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 9, 2004, 11:43am UTC](https://forum.kirupa.com/t/can-i-count-no-of-images-in-folder-from-flash/42444/4 "2004-02-09T11:43:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 9, 2004, 11:55am UTC](https://forum.kirupa.com/t/can-i-count-no-of-images-in-folder-from-flash/42444/5 "2004-02-09T11:55:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 9, 2004, 11:58am UTC](https://forum.kirupa.com/t/can-i-count-no-of-images-in-folder-from-flash/42444/6 "2004-02-09T11:58:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 9, 2004, 12:25pm UTC](https://forum.kirupa.com/t/can-i-count-no-of-images-in-folder-from-flash/42444/7 "2004-02-09T12:25:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 9, 2004, 7:25pm UTC](https://forum.kirupa.com/t/can-i-count-no-of-images-in-folder-from-flash/42444/8 "2004-02-09T19:25:32Z")

</div>

what dont you understand?
