# Randomly picking text from external textfile

**URL:** <https://forum.kirupa.com/t/randomly-picking-text-from-external-textfile/94899>\
**Category:** Uncategorized\
**Created:** [November 18, 2003, 3:58am UTC](https://forum.kirupa.com/t/randomly-picking-text-from-external-textfile/94899 "2003-11-18T03:58:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bobaphatt](https://avatars.discourse-cdn.com/v4/letter/b/ce73a5/32.png) [@bobaphatt](https://forum.kirupa.com/u/bobaphatt)\
**Post date:** [November 18, 2003, 3:58am UTC](https://forum.kirupa.com/t/randomly-picking-text-from-external-textfile/94899/1 "2003-11-18T03:58:18Z")

</div>

hi, i’m trying to display text from a textfile in a dynamic textfield, i have a text file called “quotes.txt” wich has variables set like this:  
q0=text&q1=text2&q3=text3 etc.

so how can i pick these q’s at random and place it in my textbox?

i’ve tried this:

loadText = new loadVars();  
loadText.load(“quotes.txt”);  
quotes=“q”+Math.round(random(10))  
loadText.onLoad = function() {

```
tester.text = this.quotes;

```

i thought i could replace the direct reference to q0 or q1 etc into a variable “qoutes”, so how can i do this so it does work?
