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

saving and loading files

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Can anyone help me with the code to save variables to a .txt or .xml file and then load them back in? I don't know much about xml or flash, but I'm trying to save variables that I will then use in another program.
Thanks, Jamie
 
If you want to write a TXT file from a projector file (it won't work in a SWF), use the fscommand "save" ...

fscommand("save", "myFile.txt");

That will write a TXT file with all the variables in the current timeline (I think ... it might be ALL your variables, period!).

If you want to write from a SWF, and do it online, you'll have to look into CGI solutions (and I ain't gonna be no use to ya there - sorry!). _____________________________________________________
Knowledge is attained only by seeking out that which is unknown
 
For security reasons, the save command doesn't work anymore in Flash MX. In fact it doesn't work in the standalone projector(6) player.

Using the sharedObject is the only way to do it ( or server side scripting, at which I can't help you either! Regards,

oldman3.gif
 
Hey I didn't know that Old - bummer! So the only way we're going to be able to do this from now on is to create in and publish from 5?! Macromedia have some GREAT ideas, don't they ... ? _____________________________________________________
Knowledge is attained only by seeking out that which is unknown
 
Will work from 5, if and only if the end user still has the version 5 standalone player... Which is less and less likely!
Regards,

oldman3.gif
 
Old - "save" never worked in the stand-alone player ... I was talking about making a PROJECTOR file. As far as I know projector files are self-sufficient ... they don't require any other software support.

Does this mean that "save" might still work in a projector file made with MX ... ? _____________________________________________________
Knowledge is attained only by seeking out that which is unknown
 
To me the standalone player means a projector file,
and no, save won't work, if the projector included in your .exe, is version 6 of the standalone. Regards,

oldman3.gif
 
Ahhhhhhhhhh ... the stand alone plaer gets incorporated into the EXE, thus making it playable. Now it ALL becomes clear :) _____________________________________________________
Knowledge is attained only by seeking out that which is unknown
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top