# \[flash8\] help with loadVars

**URL:** <https://forum.kirupa.com/t/flash8-help-with-loadvars/239842>\
**Category:** flash\
**Created:** [September 26, 2007, 2:53pm UTC](https://forum.kirupa.com/t/flash8-help-with-loadvars/239842 "2007-09-26T14:53:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![psyman](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/psyman/32/4063_2.png) [@psyman](https://forum.kirupa.com/u/psyman)\
**Post date:** [September 26, 2007, 2:53pm UTC](https://forum.kirupa.com/t/flash8-help-with-loadvars/239842/1 "2007-09-26T14:53:22Z")

</div>

Hi!  
I’m still a newbee on actionscript so I hope u guys can help me out.

I’m trying to load som external text width loadVars. everything’s working just fine with the example below, but i want to loop out da \*\*\*\*…

var loadText:LoadVars = new LoadVars();  
loadText.onLoad = function(success) {  
if (success) {  
txt1.text = loadText.txt1;  
txt2.text = loadText.txt2;  
} else {  
trace(“ingen text laddades!”);  
}  
};  
loadText.load(“texter.txt”);

**And I want to do something like this…**

var loadText:LoadVars = new LoadVars();  
loadText.onLoad = function(success) {  
if (success) {  
for (i=1; i\<=4; i++) {  
ref = “txt”+i;  
\_root[ref].text = [“loadText.”+ref];  
}  
} else {  
trace(“ingen text laddades!”);  
}  
};  
loadText.load(“texter.txt”);
