# Undefined Variable Loading External Text

**URL:** <https://forum.kirupa.com/t/undefined-variable-loading-external-text/78926>\
**Category:** flash\
**Created:** [February 9, 2005, 4:32am UTC](https://forum.kirupa.com/t/undefined-variable-loading-external-text/78926 "2005-02-09T04:32:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![everyday](https://avatars.discourse-cdn.com/v4/letter/e/3da27b/32.png) [@everyday](https://forum.kirupa.com/u/everyday)\
**Post date:** [February 9, 2005, 4:32am UTC](https://forum.kirupa.com/t/undefined-variable-loading-external-text/78926/1 "2005-02-09T04:32:44Z")

</div>

Still climbing the mountain learning AS; no doubt there is a simple answer to this question (I have tried unsuccessfully to find it in extant threads as well as between my ears).

Trying to augment the Kirupa tutorial “ActionScript Text Animation” ([http://www.kirupa.com/developer/actionscript/ascript\_text\_animation.htm](http://www.kirupa.com/developer/actionscript/ascript_text_animation.htm))  
to take an external text file. When I switch out the line:  
text = “There is only one…”  
with:  
myLoadVar = new LoadVars ();  
myLoadVar.load(“davetextdoc.txt”)  
myLoadVar.onLoad = function (success){  
if (success == true) {  
output.variable = “text”  
output.text=myLoadVar.text;  
}  
}  
I get the word “undefined” repeatedly loading itself. The text file is properly formatted(text=dave’s text here…) I’ve tried untold permutations to self-solve. Help is appreciated.
