# \[F8-AS2\] Creating a dynamic number of variables?

**URL:** <https://forum.kirupa.com/t/f8-as2-creating-a-dynamic-number-of-variables/249165>\
**Category:** flash\
**Created:** [January 16, 2008, 1:59am UTC](https://forum.kirupa.com/t/f8-as2-creating-a-dynamic-number-of-variables/249165 "2008-01-16T01:59:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bmo](https://avatars.discourse-cdn.com/v4/letter/b/9de0a6/32.png) [@bmo](https://forum.kirupa.com/u/bmo)\
**Post date:** [January 16, 2008, 1:59am UTC](https://forum.kirupa.com/t/f8-as2-creating-a-dynamic-number-of-variables/249165/1 "2008-01-16T01:59:39Z")

</div>

I am having a hell of a time trying to do this. I have done some (like 2 hours worth) research and have come up short, so while I browse the forums for a bit more help I thought I’d post and see if anyone can help.

Basically what I’m trying to do is create a number of variables, depending on how many items are in an xml document.

For example, I am running a for(){} loop to pull all the data I need out, and I would like to store it in the format:  
photo1.filename = whatever;  
photo1.value2 = whatever;

and so on. All the object property names (filename, value2 in the example) would be the same (obviously the values would be different), but I need the number of objects (photo1 in the example) to depend on how many nodes are in the xml document.

Any help would be greatly appreciated!

Brian
