# Need some LoadVars() help

**URL:** <https://forum.kirupa.com/t/need-some-loadvars-help/82918>\
**Category:** Uncategorized\
**Created:** [March 14, 2005, 6:32pm UTC](https://forum.kirupa.com/t/need-some-loadvars-help/82918 "2005-03-14T18:32:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gonzales](https://avatars.discourse-cdn.com/v4/letter/g/ac91a4/32.png) [@gonzales](https://forum.kirupa.com/u/gonzales)\
**Post date:** [March 14, 2005, 6:32pm UTC](https://forum.kirupa.com/t/need-some-loadvars-help/82918/1 "2005-03-14T18:32:16Z")

</div>

im working on a project that reads a .txt file and prints it’s contents into a dynamic text box. im using LoadVars to load the .txt file into a variable. the weird thing is when i trace the variable, the output box displays everything it should but the dynamic text box displays this:

onLoad=[type Function]

so what am i doing wrong? i need the loaded text to be a string… heres my AS:

[AS]  
var intervalID;  
var loadText = new LoadVars();  
loadText.load(“text.txt”);  
loadText.onLoad = function(success) {  
trace(unescape(loadText));  
intervalID = setInterval(spill, 40);  
};  
var contents = unescape(loadText);  
var to = String(contents.length);  
var from = to;  
function spill() {  
if (from\>1) {  
from = Math.floor(from\*.70);  
myTextBox.text = contents.substring(from, to);  
} else {  
myTextBox.text = contents;  
clearInterval(intervalID);  
}  
}  
stop();  
[/AS]
