This content has been marked as final. Show 19 replies
as2 or as3? in both cases, you'll need to use some server-side script like php, perl etc.
Hmm. Whichever one is easier. I'm pretty new to flash. I know how to make a basic website but I don't know how to integrate submit boxes.
I don't need it to be real hi-tech. All I want it to be able to do is save the info in some kind of text file on the server like: name | email@example.com
as2 is easier. use loadvars to send data to your server-side script.
Could you give me an example of what the code would look like? I have no clue what I'm doing. I searched Google for "loadvars" but I wasn't able to figure out how to do it.
sendLV.name=nameTF.text;// where your textfield for the user's name is nameTF
sendLV.email=emailTF.text;// where your textfield for the user's email is emailTF
sendLV.sendAndLoad("writeFile.php",receiveLV,"POST"); // where your php file is writeFile.php
Ok I made the two text fields, nammed them nameTF/emailTF, and enterted the code. But now when I click the submit button it does nothing.
Did you ever get the Submit button working? That is similar to what I have been working on and getting nowhere with it. It is not difficult for those that know php. How much Actionscript did you use...? Any stop()?
I want my form to go to an email address. The user clicks on Submit button and it should go to a Thank you page so user will know he/she has submitted the form.
Do you have a reset button on your form? What Actionscript worked there for you?
Nope, I still haven't figured out how to do it yet.
do you have a writeFile.php file?
I made a file called writeFile.php, but it does not have any script in it.
If you could make me a sample .fla with it already done, I would really appreciate it. I spent about five hours last night searching Google for a way to do this, but I couldn't find anything.
you need a writeFile.php script. flash can't write anything to your server. it can only call (or cause to execute) a script (like php) that can write a file to your server.
Yeah your sample fla was exactly what I had. I think it's the PHP part that I'm not understanding. I just searched Google for "writeFile.php" scripts and I found two scripts for transfers text from Flash to PHP to TXT. But I was unable to get them to work.
Could you modify these scripts for me so they work with what I'm trying to do?
Script 1 - Script 2
define your text file's path and name and make sure you give it permission to be written to and give permissions to your php file to be read and executed:
Mann. This is so hard. Can you please explain to me what I did wrong? I tried uploading it to my server, setting all the permissions to 777 (read, write, execute), and it still did nothing. Then I figured there was an error in my .FLA script, so I went through the same process with yours and it still didn't work.
Here is a ZIP of everything I've done so far:
(contains: submitData.fla, submitData.swf, writeFile.php, fileName.txt)
you path/name to fileName.txt is incorrect. if the text file is in the same directory with the php file, use
$file = "fileName.txt";
:( Still not working.
Could you try uploading it to your server and see if it works there? It may just be my server settings that are causing it to not work (although I doubt it).
it works without problem for me.