This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Flash Site Design > September 2007 > Displaying contents of a text file in a text box





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Displaying contents of a text file in a text box
nitrousoxide52

2007-09-05, 6:16 pm

As the topic describes, I need to display the contents of a text file in a text box. How would one go about doing this? Thanks in advance.
Xibit Studio

2007-09-06, 6:15 pm

// setting up the text format options
var FileFormat:TextFormat = new TextFormat ();

FileFormat.font = "Verdana";
FileFormat.size = 12;
FileFormat.align = "left";
FileFormat.color = 0xFFFFFF;


/// load in text from folder load_in , filename is text.txt

var my_lv:LoadVars = new LoadVars();
my_lv.onLoad = function (success:Boolean):Void{

if (success){
textfield.text = this.txtVarLoaded;
textfield.setTextFormat ( FileFormat );

} else {

trace ("error");
}
}
my_lv.load ("load_in/text.txt"); // load in text.txt

peace ;o)


Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews