Create txt file from Falsh

Can we create a txt file from the data inputs in flash.

I am using some variables in swf called form an external txt file. Can we by any chance call the variable values…update the vlaues… in flash and save them in that particular txt file (overwritte the exisiting one)

Please let me know if we can.

You can’t do it with Flash alone. You need to use PHP or ASP.

http://www.kirupaforum.com/showthread.php?s=&threadid=10150&highlight=PHP+write+to+text+file

http://www.kirupaforum.com/showthread.php?s=&threadid=12463&highlight=PHP+guestbook

*Originally posted by Jubba *
**You can’t do it with Flash alone. You need to use PHP or ASP.

http://www.kirupaforum.com/showthread.php?s=&threadid=10150&highlight=PHP+write+to+text+file**

Well the url quoted wouldn’t help discoverme, Jubba. :frowning:
It would look different this way actually, it’s like updating the textfile content instead of adding.

Here is a php script that would help you, if you can’t arrange the flash part, let me know.

<?
$datafile = "textfile.txt";
$data = "&variable1=" . $_POST['variable1'];//variable1 is from flash
$data .= "&variable2=" . $_POST['variable2'];//variable2 is from flash
$file = @fopen($datafile, 'w');
if (!$file) {
    print "&result=error";
    exit;
}
fwrite($file, $data);
fclose($file);
print "&result=success";
?>

The idea of this code is neither adding nor updating, it is simply rewriting the textfile with the specified values given from flash! Well I think it does what you need, discoverme.

I didn’t really read the post lol. I just saw Flash and writing to a text file so I posted all the files that I knew were on the forum that had to do with Text files and PHP.

Thanks a lot…i will just try it in flash.

Will it creat txt file in the format i want…example

text file should contain 4-5 variable values. So it should be like…

scroll0=23&scroll1=35&scroll2=42&scroll3=54

if you have an example ready in fla format please do send it to me. Thanks a million.

In order to create or edit a text file you need to use PHP or ASP. it is impossible to do with Flash alone.