Groups | Blog | Home
all groups > flash actionscript > may 2004 >

flash actionscript : MX2004 textarea component with external text file


B
5/14/2004 7:54:30 PM
In the past I have loaded external text into a dynamic text box and then I've
attached the scrollbar component for scrolling purposes. I have now upgraded
to 2004 and there is no longer a scrollbar component. I've looked in several
places and I'm reading that the textarea component is to be used in lieu of the
scrollbar. The only problem is, I can't find anything that shows how to load
an external text file into the textarea component. I've tried a number of
things and nothing works. Grrrrrr...

Any help would be appreciated!!

Brenda
B
5/14/2004 8:27:35 PM
Okay, I figured it out. The actionscript that's needed in 2004 isn't too much
different from MX.

The changes for MX 2004:
1) loadVariablesNum now requires 2 parameters. Before all I had to put in the
parentheses was "text.txt"
2) Where you see myText.text=scrollText, I used to put:
myText.htmlText=scrollText.
3) If you are using html formatting in your external text file, there used to
be a line you had to write that said myText.html = true; Now you just set the
html to true in the components parameter panel

loadVariablesNum("text.txt", 0);
this.onData = function() {
myText.text = scrollText;
}
AddThis Social Bookmark Button