Need help with flash and .txt files

Hi! I know there’s a way to load text from a .txt file into a flash movie… I tried that some time ago… BUT! I had the problem that flash was making double line spacing (know what i mean?).

Also i’d like to know if there’s a way SAVE a .txt file to a server / harddisc in flash. And if there is… How? PHP? Pure Flash? HTML?

HELP!

http://www.kirupa.com/developer/mx/multiple_dynamictext.htm
http://www.kirupa.com/developer/mx/externaldata.htm

there are 2 examples for loading external text…

as for your other question, yes you can save to an external text file using Flash and PHP…i added an example, and here is a brief explaination…

First, upload these files to the same directory on your server…
secret.swf, secret.html, write.php, and textdata.txt .

How it works:

The Name, and Message Input text boxes have Variable names of
name, and message respectively…

the actions on the submit button are:
[AS]
on (release) {
loadVariablesNum(“write.php”, 0, “POST”);
gotoAndStop(2);
}
[/AS]

So, when you press the button, it communicates with the write.php file on your sever which is set up like this…


<html>
<body>

<? 

// Let's declare the 2 variables: 

$name = $_POST['name']; 
$message= $_POST['message']; 

// Let's open the file we want to put the data in: 

if($REQUEST_METHOD == 'POST'){ 
$file = "textdata.txt"; 
$fp = fopen($file, "a+"); 

// Write to the file: 

fwrite($fp, $_POST['name'] . ":" . $_POST['message'] . "
");fclose($fp); 
} 
?> 


</body>
</html>

The php file, saves the name/message to the external text document textdata.txt…ofcoarse you can customize it to your needs…this just an example of how it can be done…

To get rid of double spacing, use


yourTextField.condenseWhite = true;

:wink:

Ey thx!! I’ve just got that problem taht i have no experience in PHP… Can i use it anyway?

Guys? It doesn’t work! :*( Why?!?! I’m so sure that the server has php support but it just wont write the file!!!:puzzle: It’s driving me crazy!!! :drool: