# Loading Different Text Files Using Buttons To Display In One Content Box

**URL:** <https://forum.kirupa.com/t/loading-different-text-files-using-buttons-to-display-in-one-content-box/252254>\
**Category:** flash\
**Created:** [February 18, 2008, 2:13pm UTC](https://forum.kirupa.com/t/loading-different-text-files-using-buttons-to-display-in-one-content-box/252254 "2008-02-18T14:13:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dacinto](https://avatars.discourse-cdn.com/v4/letter/d/ce73a5/32.png) [@dacinto](https://forum.kirupa.com/u/dacinto)\
**Post date:** [February 18, 2008, 2:13pm UTC](https://forum.kirupa.com/t/loading-different-text-files-using-buttons-to-display-in-one-content-box/252254/1 "2008-02-18T14:13:18Z")

</div>

Hello,  
I am a newbie on the forum as well as to Flash and as expected I,m already into problems. I have over 20 buttons with over 20 frames in my movie. I want each button, when clicked, to got to a required frame and then load text dynamically from an extrernal file, displaying it in the same content box. I have tried loads of technics but dont seem to get it working. Please help!!

Here is the code attached to one of my buttons:

on (release) {  
gotoAndstop (“home”);  
loadText = new LoadVars();  
loadText.load(“myhome.txt”);  
loadText.onLoad = function(success) {  
if (success) {  
// trace(success);  
scroller\_text.html = true;  
scroller\_text.htmlText = this.mypage1;  
}  
};  
}

With the above code I am able to go to the home page at the click of the button “home” but text from “myhome.txt” does not load. Please help!  
Thanks.
