# Scrollable texts in MX

**URL:** <https://forum.kirupa.com/t/scrollable-texts-in-mx/22143>\
**Category:** Uncategorized\
**Created:** [May 30, 2003, 9:20pm UTC](https://forum.kirupa.com/t/scrollable-texts-in-mx/22143 "2003-05-30T21:20:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![catreya](https://avatars.discourse-cdn.com/v4/letter/c/b38774/32.png) [@catreya](https://forum.kirupa.com/u/catreya)\
**Post date:** [May 30, 2003, 9:20pm UTC](https://forum.kirupa.com/t/scrollable-texts-in-mx/22143/1 "2003-05-30T21:20:41Z")

</div>

This is regarding the tutorial at Kirupa.  
[http://www.kirupa.com/developer/mx/dynamic\_scroller.htm](http://www.kirupa.com/developer/mx/dynamic_scroller.htm)

For loading the text from a txt document i am using the following code (which is the same as Kirupa’s code - except for the names)  
[AS]  
/\* Load Welcome Message _/  
loadText = new LoadVars();  
loadText.load(“welcome.txt”);  
//creating the loadVarsText function  
loadText.onLoad = function() {  
scrollableText.text = this.welcometext;  
};  
/_ End of Welcome Messge \*/  
[/AS]

However, only the first three words of the txt doc file is displayed.

I am not using the component scroller but using my own buttons and codes for scrolling vertically. Those codes are:  
[AS]  
on (press, release, keyPress “\<Up\>”) {  
currentScroll = scrollableText.scroll;  
if (Number(currentScroll)\>1) {  
scrollableText.scroll = currentScroll-1;  
}  
}

on (press, release, keyPress “\<Down\>”) {  
currentScroll = scrollableText.scroll;  
if (Number(currentScroll)\<Number(scrollableText.maxscroll)) {  
scrollableText.scroll = Number(currentScroll)+1;  
}  
}  
[/AS]

If i declare the value of the variable “scrollableText” within the actions panel then it works.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 30, 2003, 9:27pm UTC](https://forum.kirupa.com/t/scrollable-texts-in-mx/22143/2 "2003-05-30T21:27:14Z")

</div>

Would you believe it? I close the flash program and restarted it and it worked!

Wonder wat the magic is!!!

:whistle:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 30, 2003, 9:47pm UTC](https://forum.kirupa.com/t/scrollable-texts-in-mx/22143/3 "2003-05-30T21:47:28Z")

</div>

Now me thinks if there is a way to go about unloading the txt file??? I have looked at the functions of flash but could find nothing that could be of help.

Any suggestions???

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 30, 2003, 11:26pm UTC](https://forum.kirupa.com/t/scrollable-texts-in-mx/22143/4 "2003-05-30T23:26:24Z")

</div>

got it. but i cant unload. just give a null value to the textbox.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 31, 2003, 12:12am UTC](https://forum.kirupa.com/t/scrollable-texts-in-mx/22143/5 "2003-05-31T00:12:31Z")

</div>

now I am stuck. I converted the dynamic text loading into the prototype on the main time line.  
[AS]  
MovieClip.prototype.hometext = function() {  
loadText = new LoadVars();  
loadText.load(“a.txt”);  
//creating the loadVarsText function  
loadText.onLoad = function() {  
scrollableText.text = this.b;  
};  
/\* End of Welcome Messge \*/  
}  
[/AS]

now i goto into a button (which) is not the main time line and give this code  
[AS]  
on (release) {  
.  
\_root.hometext();  
}  
[/AS]

This button in the main time line is a movie clip - but acts as a button once u get into it by pressing CTRL-E. (sorry dont know the terminology yet)

So the on release event is not on the main timeline. The above doesnt work. I have tried variations like:  
[AS]  
\_parent.hometext();  
this.\_root.hometext();  
this.\_parent.hometext();  
[/AS]

dont work. Am i doing the right thing here?
