# Displaying Data from an External File by pressing a button

**URL:** <https://forum.kirupa.com/t/displaying-data-from-an-external-file-by-pressing-a-button/133681>\
**Category:** Uncategorized\
**Created:** [January 11, 2005, 12:24am UTC](https://forum.kirupa.com/t/displaying-data-from-an-external-file-by-pressing-a-button/133681 "2005-01-11T00:24:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SC5](https://avatars.discourse-cdn.com/v4/letter/s/71e660/32.png) [@SC5](https://forum.kirupa.com/u/SC5)\
**Post date:** [January 11, 2005, 12:24am UTC](https://forum.kirupa.com/t/displaying-data-from-an-external-file-by-pressing-a-button/133681/1 "2005-01-11T00:24:32Z")

</div>

[font=verdana, arial, helvetica][size=2]Alright guys, I’m almost done with my site ![](http://www.flashkit.com/board/images/smilies/smile.gif) just one last actionscript stub. I’m loading text from an external file (a notepad). Now all I want is to be able to change the text by loading text from another external file when a certain button is pressed. Basically, I got this as my default text which loads automatically at the start:

loadText = new LoadVars();  
loadText.load(“data.txt”);  
loadText.onLoad = function() {  
title.text = this.title;  
info.text = this.info;  
body.text = this.body;

};

but now I want to load text from a different file (data2.txt) by the press of a button. I also have a transition animation so work with me. It would be…

b3.onRelease = function() {  
if (\_root.section != “photos.swf”) {  
//I also got this pic (swf) that changes on the button release//  
\_root.section = “photos.swf”;  
\_root.transition.gotoAndPlay(“closing”);

so what exactly do I add to be able to change the text source?[/size][/font]
