# Multiple scrolling text boxes from text files

**URL:** <https://forum.kirupa.com/t/multiple-scrolling-text-boxes-from-text-files/253539>\
**Category:** Uncategorized\
**Created:** [March 2, 2008, 7:44pm UTC](https://forum.kirupa.com/t/multiple-scrolling-text-boxes-from-text-files/253539 "2008-03-02T19:44:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BillH](https://avatars.discourse-cdn.com/v4/letter/b/5f9b8f/32.png) [@BillH](https://forum.kirupa.com/u/BillH)\
**Post date:** [March 2, 2008, 7:44pm UTC](https://forum.kirupa.com/t/multiple-scrolling-text-boxes-from-text-files/253539/1 "2008-03-02T19:44:02Z")

</div>

[FONT=Calibri][SIZE=3]Hello![/SIZE][/FONT]  
[FONT=Calibri][SIZE=3]I have been trying to solve this problem long enough and need some help.[/SIZE][/FONT]  
[FONT=Calibri][SIZE=3]I am creating this in Flash 8.[/SIZE][/FONT]  
[FONT=Calibri][SIZE=3]I want to have a text area that has scrolling text. The text is brought in from a text file (one ending in .txt). Yes, there are a zillion tutorials that detail the steps. In fact, I have it working. The example that worked for me was one in which the scroll component was used and some action scripting. Works perfectly.[/SIZE][/FONT]  
[FONT=Calibri][SIZE=3]But not one that gives me a clue what to do if I want multiple text boxes using various external text files.[/SIZE][/FONT]  
[FONT=Calibri][SIZE=3]I have the timeline with the cells set-up so each cell is a new page (there is a script stop; to accomplish this along with keyframes).The idea is to navigate to a keyframe and it appears as if it is a new page. A box with a graphic in it changes, and a box for dynamic scrolling text exists. I got the first “page” with perfect scrolling text from an external text file. [/SIZE][/FONT]  
[FONT=Calibri][SIZE=3]Here’s the action script:[/SIZE][/FONT]  
[FONT=Calibri][SIZE=3]myVars = new LoadVars();[/SIZE][/FONT]  
[FONT=Calibri][SIZE=3]myVars.onLoad = function(){[/SIZE][/FONT]  
[SIZE=3][FONT=Calibri] textbox.text=this.Grun01;[/FONT][/SIZE]  
[FONT=Calibri][SIZE=3]};[/SIZE][/FONT]  
[FONT=Calibri][SIZE=3]myVars.load(“scroll01.txt”);[/SIZE][/FONT]  
[FONT=Calibri][SIZE=3] [/SIZE][/FONT]  
[FONT=Calibri][SIZE=3]Now, if I do this same thing for the next page, all the pages stop working. The text files are different as are their first lines before the = signs. They are as such (in part):[/SIZE][/FONT]  
[FONT=Calibri][SIZE=3]File called scroll01.tx has a first line Grun01=[/SIZE][/FONT]  
[FONT=Calibri][SIZE=3]No html was used.[/SIZE][/FONT]  
[FONT=Calibri][SIZE=3]The text box’s properties were set to Dynamic, multipleline and an instance of textbox. The UIscrollBar instance was with parameters set to textbox.[/SIZE][/FONT]  
[FONT=Calibri][SIZE=3]I did the second text box (in the next cell) to load scroll02.txt, a first line of Grun02= and changed the action script to:[/SIZE][/FONT]  
[FONT=Calibri][SIZE=3]myVars = new LoadVars();[/SIZE][/FONT]  
[FONT=Calibri][SIZE=3]myVars.onLoad = function(){[/SIZE][/FONT]  
[SIZE=3][FONT=Calibri] textbox.text=this.Grun02;[/FONT][/SIZE]  
[FONT=Calibri][SIZE=3]};[/SIZE][/FONT]  
[FONT=Calibri][SIZE=3]myVars.load(“scroll02.txt”);[/SIZE][/FONT]  
[FONT=Calibri][SIZE=3]I also varied the text box’s properties to an instance of textbox02. The UIscrollBar instance was with parameters set to textbox02.[/SIZE][/FONT]  
[FONT=Calibri][SIZE=3]What do I need to do to be able to have each page with scrolling text loaded from an external file?[/SIZE][/FONT]  
[FONT=Calibri][SIZE=3]Thanks in advance,[/SIZE][/FONT]  
[SIZE=3][FONT=Calibri] Bill H.[/FONT][/SIZE]
