Groups | Blog | Home
all groups > macromedia flash sitedesign > september 2007 >

macromedia flash sitedesign : Displaying contents of a text file in a text box


nitrousoxide52
9/5/2007 10:04:44 PM
Xibit Studio
9/6/2007 10:00:45 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)

AddThis Social Bookmark Button