Hey friends, i am working on a project in which a user enters something in a text field and then presses a button then the value of that text field is saved in an external text file., hope u understand my problem. Thanks in advance.
Printable View
Hey friends, i am working on a project in which a user enters something in a text field and then presses a button then the value of that text field is saved in an external text file., hope u understand my problem. Thanks in advance.
Hi,
A very basic way is like so,
your flash button commandand the matching php file called save.php like so (same directory)PHP Code:button.onPress = function()
{
SubmitData();
};
function SubmitData()
{
var SendData = new LoadVars();
SendData.Word = MyText.text;
SendData.send("save.php","_blank","POST");
}
for home testing you will need your apache / IIS home serverPHP Code:<?php
$FlashVar1 = $_POST['Word'];
$FlashVar2 = "You saved this ".$FlashVar1;
$Document = "save.txt";
$Saver = fopen($Document,"w");
fwrite ($Saver, $FlashVar2);
fclose($Saver);
echo $FlashVar2."<br / > here is the text file <a href='$Document' target='_blank'>Here</a>";
?>
Thanks but i want it for flash as 2 actionscript.pls giv me
Hi,
It is AS2, if you want to do it without a server side language then you will need to use AS3, which I am unable to help you with.