# Dynamically Loaded Text Question

**URL:** <https://forum.kirupa.com/t/dynamically-loaded-text-question/231876>\
**Category:** Uncategorized\
**Created:** [July 9, 2007, 8:28am UTC](https://forum.kirupa.com/t/dynamically-loaded-text-question/231876 "2007-07-09T08:28:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JeffGirard](https://avatars.discourse-cdn.com/v4/letter/j/a5b964/32.png) [@JeffGirard](https://forum.kirupa.com/u/JeffGirard)\
**Post date:** [July 9, 2007, 8:28am UTC](https://forum.kirupa.com/t/dynamically-loaded-text-question/231876/1 "2007-07-09T08:28:43Z")

</div>

I have text loading into a text box via the following code:

```auto
loadText = new LoadVars();
loadText.load("main.txt");
loadText.onLoad = function() {
        scroller.text = this.textsrc;
};

```

This works beautifully and I am happy with it. However, I would like to ActionScript (2.0) to change where the text loads from on the release of a button I have made. I tried putting this on the button, but it did not work:

```auto
on (release) {

loadText.load("about.txt");
loadText.onLoad = function() {
        scroller.text = this.textsrc;
};

```

I’m hoping this is an easy thing to do and I am just too new or tired to see it. Anyway, any help would be appreciated. Thanks!
