DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Reading A Field Value From A Text File Using LoadVars()
// description of your code here
Provided a file called mytextfile.txt containing the following line:
------------------------------------
firstname=harold&lastname=mike
-----------------------------------
The following code load into the value of field firstname into a dynamic text instance.
var nameVars= new LoadVars();
nameVars.onLoad=function(ok) {
if(ok)
{
trace("Loading");
text_var=nameVars.firstname;
}
};
nameVars.load("mytextfile.txt");





