# Problem with text loaded externally

**URL:** <https://forum.kirupa.com/t/problem-with-text-loaded-externally/88854>\
**Category:** Uncategorized\
**Created:** [May 3, 2005, 3:25am UTC](https://forum.kirupa.com/t/problem-with-text-loaded-externally/88854 "2005-05-03T03:25:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![maciejwantusiak](https://avatars.discourse-cdn.com/v4/letter/m/b9e5f3/32.png) [@maciejwantusiak](https://forum.kirupa.com/u/maciejwantusiak)\
**Post date:** [May 3, 2005, 3:25am UTC](https://forum.kirupa.com/t/problem-with-text-loaded-externally/88854/1 "2005-05-03T03:25:38Z")

</div>

Hi,  
I have this mc containing a dynamic text field and the stuff for this text field is loaded from a .txt file.  
In my .txt I have variables named …,txt4, txt3, txt2, txt1, txt0, which are basically html texts.  
What I need to do and I don’t know how is to have some method to change which variable should be loaded, i.e. txt2 after txt3.  
This is the code that I have for geting the text:

```auto
stop();
var myCSS = new TextField.StyleSheet();
myCSS.load("style.css");
myCSS.onLoad = function(success) {
 if (success) {
  loadTekst(myCSS);
 } else {
  err.text = "Could not load CSS style sheet";
 }
};
loadTekst = function (style) {
 loadText = new LoadVars();
 if ((_root.langchoice == "pl") || (_root.langchoice == undefined)) {
  err.text = "wczytuje tekst";
  loadText.load("news_pl.txt");
 } else if (_root.langchoice == "en") {
  err.text = "loading text";
  loadText.load("news_en.txt");
 }
 loadText.onLoad = function(success) {
  if (success) {
   info_mc.info.[color=black]htmlText[/color] = true;
   info_mc.info.styleSheet = style;
   info_mc.info.htmlText = txt; //<---- this has to be changed
   gotoAndPlay(2);
  } else {
   err.text = "Error loading the info text file";
  }
 };
};
  

```

I thought about using another variable that could store the number of the items but still, I need a way to manipulate the [color=red][color=darkred]info\_mc.info.htmlText =[/color] [color=red]txt[/color]; [/color][color=black]so it loads the required txt variable.[/color]  
Any thoughts on how to do it?  
Thanks
