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

Saving Varaibles Externally

Status
Not open for further replies.

Wyrm2012

Programmer
Jul 3, 2001
38
GB
Is there a way to save variables that a user has typed into Input text-fields to an external file? I want the user to have an address book of personal numbers which will be remembered each time they open the Flash movie. This way they won't have to type them in each time.

I know that variables can be stored in an external .txt file and then displayed in a Flash movie. But can they be saved to the file from within Flash? Live forever or die trying.
 
Thanks for the above. However the Flash movie I am making is more like a stand-alone application that will be sold to clients as a package. An internet connection would be required to login and actually utilise the features but the information in the Address Book could be stored locally on the client's machine and wouldn't have to be on the server.
Does this make it easier?

Cheers, Live forever or die trying.
 
If anyone can tell me the chr number for an ampersand I think I can make this work but failing that here is the detailed version of my problem.

I've downloaded that save-to-disk.fla and it works fine but (even though it seems pretty simple) when I integrated it into my own movie it doesn't work so well. Firstly the file created is ONTENT.txt instead of CONTENT.txt. I succeeded in saving my variables to the file but when I load them into the movie it treats all 14 variables as 1.

The 'Save' button does:

on (press) {
fscommand ("exec", "command.com" add chr(9) add "/c" add chr(9) add "echo" add chr(9)
add "name1=" add name1 add chr(9)
add "num1=" add num1 add chr(9)
add "name2=" add name2 add chr(9)
add "num2=" add num2 add chr(9)

Here is the code I used in the first frame of the movie:

loadVariables ("file:///c|/ontent.txt", "_root.address");
_root.address.name1 = name1;
_root.address.num1 = num1;
_root.address.name2 = name2;
_root.address.num2 = num2;

The trouble is the value of variable name1 is all of the variables together:
eg: "bw\tnum1=1234\tname2=\tnum2=\t\r\n"

I've no idea where the t\r\n comes from at the end. I've almost got this working so any help would be great.
Thanks
Live forever or die trying.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top