Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get flash to read data from an Input file.

Status
Not open for further replies.

Sidro

MIS
Sep 28, 2002
197
US
hi,
im making a flash application and it will not be used online. How do I get flash to read a simple txt file filled with a list of people's name? example,

joe
mary
larry
greg
tom

I would like flask to go through the data file, reading each name into a variable then output it into a text box.

Also, how do I get it to output the names to a regular text file? thankx in advance.
 
to load the data

text file

&content=Mary,joe,bill&

this will work best if names separated by commas though any delimiter will be fine
Code:
flash

lv = new LoadVars()
lv.onLoad = function(){
names = lv.content.split(",");
for(var i = 0;i<names.length;i++){
_root.createTextField(&quot;mytext&quot; + i,i + 1,100,30*i,150,30);
_root[&quot;mytext&quot; + i].text = names[i]
}
}
lv.load(&quot;names.txt&quot;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top