# Filename to array

**URL:** https://forum.kirupa.com/t/filename-to-array/5273
**Category:** Uncategorized
**Created:** [September 6, 2002, 8:24am UTC](https://forum.kirupa.com/t/filename-to-array/5273 "2002-09-06T08:24:00Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ahoo75](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@ahoo75](https://forum.kirupa.com/u/ahoo75)
#### Post date: [September 6, 2002, 8:24am UTC](https://forum.kirupa.com/t/filename-to-array/5273/1 "2002-09-06T08:24:00Z")

</div>

anyone can advice how i can dynamically read all the filenames in a directory and put them into an array. thank you for you help.

---

<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: [September 6, 2002, 1:12pm UTC](https://forum.kirupa.com/t/filename-to-array/5273/2 "2002-09-06T13:12:31Z")

</div>

You’ll need PHP.  
Generate a string with all the filenames in php (don’t really know how, but it shouldn’t be too hard…).  
the output should look something like this.  
&file1=filename&file2=filename2&file3=filename3…  
then use loadvars in flash to get the values in your movie

that’s all I know (and I know it’s not much)…  
Stanley

---

<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: [September 6, 2002, 1:28pm UTC](https://forum.kirupa.com/t/filename-to-array/5273/3 "2002-09-06T13:28:15Z")

</div>

well you could edit the text file ur self…posibly put a variable at the start defining the length and then just use load vars to load it up onto the array

To load it up u would have like a for next loop going

```php

for(i=0;i>=<number>;++i){
myArray* = eval("var"+1);
}

```

And yeah that would load it up.

And with that u could still have ur php script setting the text file…just have the first var something like varNumber increment every time you add an entry and stuff like that… 🙂
