Hi guys. I want to store variables into a .txt file for flash to read them later. It's my first work on php so I don't know if there are better ways for doing this. In the php file (called "new.php") I have:
That is for php to write over the file "new.txt" like this: name=yourname&score=yourscore, so flash can load the variables from the txt file using load (or loadVariables).PHP Code:<HTML>
<BODY>
<?
$nombre_archivo = 'new.txt';
$gestor = fopen($nombre_archivo, 'w');
$contenido = "name=" . $name . "&score=" . $score;
fwrite($gestor, $contenido);
fclose($gestor);
?>
</BODY>
</HTML>
Please try the swf here . You'll notice that the first time it stores the name and the score, but then if you try again it doesn't seem to work, or sometimes you have to wait a long time until it stores them.
Does anyone know why is this happening?
I'm attaching the .fla file, i'd like you to check it out please, cus I'm using loadVars and I'm not familiar with them, it's the first time I need them so I don't actually know how they work and there are some things in the code there that I don't even know what they do, they just work. So please if anyone could help me with this and tell me why is this happenning or a better and more efficient way to do it I'll really appreciate it.
Thanx in advance :)
p.s. thanx for the tute tonypa
