# Lading data from txt file shows undefined?

**URL:** <https://forum.kirupa.com/t/lading-data-from-txt-file-shows-undefined/280893>\
**Category:** flash\
**Created:** [February 2, 2009, 7:53pm UTC](https://forum.kirupa.com/t/lading-data-from-txt-file-shows-undefined/280893 "2009-02-02T19:53:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gunko2](https://avatars.discourse-cdn.com/v4/letter/g/c67d28/32.png) [@gunko2](https://forum.kirupa.com/u/gunko2)\
**Post date:** [February 2, 2009, 7:53pm UTC](https://forum.kirupa.com/t/lading-data-from-txt-file-shows-undefined/280893/1 "2009-02-02T19:53:21Z")

</div>

Hi, I have this little code, just loading text from a file, but as the title says, the variable s seams to remain unchanged :S

```auto
var s:String;
var loadText:LoadVars = new LoadVars();
loadText.onData = function(thisIsAText:String) {
 s = thisIsAText;
//if i put a trace here, it's ok :S
};
loadText.load("test.txt");
trace(s);

```

What’s going here?

Thanks in advance, Alex.
