# Creating variables on the fly

**URL:** <https://forum.kirupa.com/t/creating-variables-on-the-fly/81373>\
**Category:** Uncategorized\
**Created:** [March 2, 2005, 1:12am UTC](https://forum.kirupa.com/t/creating-variables-on-the-fly/81373 "2005-03-02T01:12:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nath\_y](https://avatars.discourse-cdn.com/v4/letter/n/b9e5f3/32.png) [@nath\_y](https://forum.kirupa.com/u/nath_y)\
**Post date:** [March 2, 2005, 1:12am UTC](https://forum.kirupa.com/t/creating-variables-on-the-fly/81373/1 "2005-03-02T01:12:46Z")

</div>

I can’t get flash to recognize variable names that I create on the fly.

For instance, I have dynamic text boxes named slideText1, slideText2, and slideText3, etc, which I want to fill with data from an XML file. In this code, the trace spits out the proper variable name, but Flash won’t recognise it as a variable, and so does not update the dynamic text accordingly.

(i=1; i\<(totalSlides+1); i++) {  
variable\_holder=“slideText”+i;  
variable\_holder= currentSlideNode.firstChild.nodeValue;  
trace(variable\_holder);  
currentSlideNode=currentSlideNode.nextSibling;  
}

I’ve tried eval and arrays, but can’t create variable names on the fly. Help?
