# Many txt files to same movie on btn press?

**URL:** https://forum.kirupa.com/t/many-txt-files-to-same-movie-on-btn-press/163430
**Category:** flash
**Created:** [September 22, 2005, 12:15pm UTC](https://forum.kirupa.com/t/many-txt-files-to-same-movie-on-btn-press/163430 "2005-09-22T12:15:04Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![yossarian](https://avatars.discourse-cdn.com/v4/letter/y/9de0a6/32.png) [@yossarian](https://forum.kirupa.com/u/yossarian)
#### Post date: [September 22, 2005, 12:15pm UTC](https://forum.kirupa.com/t/many-txt-files-to-same-movie-on-btn-press/163430/1 "2005-09-22T12:15:04Z")

</div>

I’ve managed to load text to various sections of my movie when it opens. Now I’d like to have the opportunity to have several txt files loaded in the same way but only on button press. For example, users click **btn\_21** and **21.txt** is loaded into the movie. How could I achieve this please?

This is the code I’m using on Frame 1:

```auto
myData = new LoadVars();
//Make a reference to current timeline
//Callback handler and data fetching
myData.onLoad = function(ok) {
    //we move to the other frames only after the outside data is loaded.
    if (ok) {
        play();
    } else {
        mess.text = "Something went wrong when loading";
    }
};
myData.load("anastasio2.txt");
stop();

```

and Frame 2:

```auto
//now we access data form myData object that holds the loaded data from outside
for (i=0; i<=4; i++) {
    eval("Title_txt"+i).text = myData["Title"+i];
    eval("Comments_txt"+i).text = myData["Comments"+i];
}

stop();

```

Any help would be appreciated for sure!!! :sure:

Yossi
