# Trouble with loadVars Variable

**URL:** <https://forum.kirupa.com/t/trouble-with-loadvars-variable/267697>\
**Category:** Uncategorized\
**Created:** [August 4, 2008, 8:57pm UTC](https://forum.kirupa.com/t/trouble-with-loadvars-variable/267697 "2008-08-04T20:57:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![err14](https://avatars.discourse-cdn.com/v4/letter/e/a698b9/32.png) [@err14](https://forum.kirupa.com/u/err14)\
**Post date:** [August 4, 2008, 8:57pm UTC](https://forum.kirupa.com/t/trouble-with-loadvars-variable/267697/1 "2008-08-04T20:57:13Z")

</div>

I am modifying a quiz that imports a number from an external text file in order to tell flash which xml file to load (the file that has the quiz questions). The variables seem to load (I’ve checked list variables), but when I try to concatenate the variable I get an ‘undefined’. How to I call this variable?

[FONT=Courier New]//loadVars from Data Source  
myVariables = new LoadVars();  
myVariables.load(“data.txt[/FONT][FONT=Courier New]”);  
myVariables.onLoad = function(success){  
if(success){  
trace(this.[COLOR=red]quiznumber[/COLOR]);  
} }[/FONT]  
[FONT=Courier New][/FONT]  
[FONT=Courier New]//Generate Question Array  
var quizItems=new Array();  
var myData=new XML();  
myData.ignoreWhite=true;  
myData.onLoad=onQuizData;  
myData.load(“quiz[/FONT][FONT=Courier New]”+[COLOR=red]quiznumber[/COLOR]+".xml");  
stop();[/FONT]
