# Accessing random variables in external .txt file

**URL:** <https://forum.kirupa.com/t/accessing-random-variables-in-external-txt-file/313716>\
**Category:** flash\
**Created:** [September 8, 2010, 5:42am UTC](https://forum.kirupa.com/t/accessing-random-variables-in-external-txt-file/313716 "2010-09-08T05:42:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![asheesh88](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@asheesh88](https://forum.kirupa.com/u/asheesh88)\
**Post date:** [September 8, 2010, 5:42am UTC](https://forum.kirupa.com/t/accessing-random-variables-in-external-txt-file/313716/1 "2010-09-08T05:42:59Z")

</div>

Hi all,

I think this may be a simple solution, but I am not familiar enough with Flash to figure it out.

I have a .txt file with 10 variables containing 10 sentences. The variables are named myText1, myText2, myText3, etc.

I want to be able to load one of these sentences at random into a dynamic text box.

My plan was to generate a random number i and concatonate it to the variable name (ie myText + i) then call that in a LoadVars.

However, I am not able to properly reference it.

Any ideas?

Thanks,

Asheesh
