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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loading Variables from .txt

Status
Not open for further replies.

FellHammer

Programmer
Dec 1, 2000
15
US
hello,

I was wondering if someone can tell me(and by that I mean show me exact code) how to load a variable out of a text file named context.txt, where the variable is a line that reads "text3=Name" in Flash5. This has been giving me trouble for some time now, and I just want to fix it. Any help would be greatly appreciated.

Thank you.

Collin
 
thread250-52182

... Might help you out!

;-) "If nothing else, I can always serve as a bad example!”

 
All you got to do is this:

on (release) {
loadVariablesNum ("newfolder/newfile.txt", 0);
}

Make sure you have your text variable named correctly in flash. In this case I'm using "name1". Text file should look like this:

name1=Beaver Cleaver

That's all the text file should read. If you want to use html tags in the .txt file it's fine (you can link out, make bold text, Italics, whatever from the text file) make sure you have the dynamic text option set to allow for html tags. The tricky thing was figuring out how to reference to two different variables in flash from the same text file (I couldn't find this in help files anywhere). I figured it out on accident. If you have two names (i.e., name1 and name2) you want to call up from a text file into flash, the .txt file should look like this, and the loadvariablesnum stay the same.

name1=Beaver Cleaver &name2=Eddie Haskel

That's it.

good luck

Blended
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top