# Loading external TXT file with button (undefined issue)

**URL:** <https://forum.kirupa.com/t/loading-external-txt-file-with-button-undefined-issue/198241>\
**Category:** flash\
**Created:** [August 23, 2006, 1:28pm UTC](https://forum.kirupa.com/t/loading-external-txt-file-with-button-undefined-issue/198241 "2006-08-23T13:28:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jezzhaigh](https://avatars.discourse-cdn.com/v4/letter/j/dfb087/32.png) [@jezzhaigh](https://forum.kirupa.com/u/jezzhaigh)\
**Post date:** [August 23, 2006, 1:28pm UTC](https://forum.kirupa.com/t/loading-external-txt-file-with-button-undefined-issue/198241/1 "2006-08-23T13:28:36Z")

</div>

Hello,

I have this problem when loading external text files with HTML using a button (not onClipEvent):

When the button is pressed online, ‘undefined’ shows up in the txt field. Pressing the button again remedies the situation and the txt loads fine.

Here is the code:

on (press) {  
loadVariables(“aboutus.txt”, this);  
}  
on (release) {  
\_root.about.scroller.htmlText = this.aboutustext;  
}

I’m assuming it’s something to do with the data not being able to finish loading in time? Pathing issue?

It works fine when the page loads first off using:

onClipEvent (load) {  
loadVariables(“aboutus.txt”, this);  
}  
onClipEvent (data) {  
\_root.about.scroller.htmlText = this.aboutustext;  
}

Any idea’s? Cheers.
