I Need Help with Forms in Flash!

Discussion in 'Techforge' started by $corp, Jun 13, 2008.

  1. $corp

    $corp Dirty Old Chinaman

    Joined:
    Mar 29, 2004
    Messages:
    15,867
    Location:
    Calgary, Alberta
    Ratings:
    +7,101
    I was wondering if any of you have designed simple forms in Flash. I am currently using Flash 4, but I get the feeling that this is so simple, some of you can answer it even if you are experienced using the latest version.

    I went through this tutorial on how to build forms here:
    http://www.flashkit.com/tutorials/Dy...F-15/index.php

    I got down to page 3, then I get this little gem:

    Um, what is this CGI they speak of? Is this an easy thing to understand?

    Basically, I just want what they wrote in the form (in my Flash page) to get submitted to an email address.

    I have some webspace, and in it, there is a folder called cgi. I am assuming the CGI goes in here. Can I edit the CGI script as a text document in MS-Word or Wordpad?
    • Agree Agree x 1
  2. Kyle

    Kyle You will regret this!

    Joined:
    Mar 29, 2004
    Messages:
    9,150
    Location:
    California?!?!
    Ratings:
    +2,814
    Ouch, Flash 4? Any reason why you can't move up in the world a bit? Hell, I don't even know what ActionScript looks like for that, or if it was even called ActionScript back then.

    I know nothing about CGI, but the step is necessary, at any rate, because Flash doesn't have a built-in mailing function. Essentially, what Flash would be doing here is sending the form data to another page, the page reads it, formats it into an e-mail, then uses the mail server set up on your web space to send it.

    EDIT - Any text editing you do will need to be done in a plain-text document writer like Notepad, then with the file extension renamed to .CGI. Wordpad/Word will add a bunch of extra formatting that will fuck everything up.
    • Agree Agree x 1
  3. $corp

    $corp Dirty Old Chinaman

    Joined:
    Mar 29, 2004
    Messages:
    15,867
    Location:
    Calgary, Alberta
    Ratings:
    +7,101
    Yeah, Flash 4. My previous job didn't require Flash at all, and I just did it for a hobby. I do have Flash CS3, but I just need to play around with it a little before completely adapting it. I opened it up and did a few online tutorials, and for the most part, it seems like it runs similar to Flash 4, so that's good. It does have a proper actionscript compiler thingy now, but I wouldn't know anything about that.
  4. Ryan

    Ryan Killjoy

    Joined:
    Mar 29, 2004
    Messages:
    7,484
    Location:
    Lincoln, Nebraska
    Ratings:
    +1,173
    It's a script file, often but not always written in Perl, that's mostly used for parsing forms, generating web pages, that sort of thing. Most web hosts will only let you run them in a folder named "cgi-bin".

    For editing I'd recommend Notepad++ (Wordpad can work in a pinch as can Notepad but stay far away from MS Word). If they didn't actually provide you with the script there are a number of free form mailers out there. Matt's FormMail is probably the most popular.
  5. Paladin

    Paladin Overjoyed Man of Liberty

    Joined:
    Mar 29, 2004
    Messages:
    50,154
    Location:
    Spacetime
    Ratings:
    +53,512
    Here's my $.02:

    When you press the 'Send' button, you cause its 'On (Release)' event handler to be executed.

    The 'On (Release)' handler sends (POSTs) the contents of the controls (the text entered in them) to a web server.

    The web server executes a program or script called 'myform.cgi.' which, when executed, takes the text from your form, does some processing, and probably returns an HTML document that can be displayed in a web browser.

    Here is a good example of POSTed data being re-formatted into an HTML webpage by a CGI program.
    • Agree Agree x 1
  6. $corp

    $corp Dirty Old Chinaman

    Joined:
    Mar 29, 2004
    Messages:
    15,867
    Location:
    Calgary, Alberta
    Ratings:
    +7,101
    Hmm, well, ok, it looks like some hosting companies actually provide you with the formail.cgi file in case you want to do something like this. I will have to contact my hosting company to see where mine is. And yes, you are right in that most web servers have a CGI bin they use to put all their .cgi files.
  7. $corp

    $corp Dirty Old Chinaman

    Joined:
    Mar 29, 2004
    Messages:
    15,867
    Location:
    Calgary, Alberta
    Ratings:
    +7,101
    I downloaded matt's formail, but I couldn't make heads or tails of it. There is just too much in it and whatever you are suppose to change is blank. He just gives you the form, and you are suppose to open it up and know exactly what to look for. I even tried reading through the readme file, and couldn't figure it out.

    I hope the hosting .cgi file will be easier to use.
  8. Zenow

    Zenow Treehugger

    Joined:
    Mar 28, 2004
    Messages:
    4,081
    Location:
    Netherlands
    Ratings:
    +897
    Flash 4 is nothing like Flash CS3, you won't recognize the Actionscript. For simple things like a form, I'd recommend getting Flash 8 and doing a tutorial like this one.
    CGI is dead, use PHP instead, your hosting provider probably supports it.
    I haven't tried the tutorial on that site, but it looks simple enough and I'm too lazy to write my own :P
    -edit- did test it - all I did was change the email-address in the email.php file, and it worked. IF it doesn't, you can use phpmailer, but I don't think that's necessary.
    • Agree Agree x 1
  9. Ryan

    Ryan Killjoy

    Joined:
    Mar 29, 2004
    Messages:
    7,484
    Location:
    Lincoln, Nebraska
    Ratings:
    +1,173
    It almost assuredly is. Some hosting companies will install FormMail or a clone with all the variables for your account preset. You'll still probably have to do some customization.
  10. Ryan

    Ryan Killjoy

    Joined:
    Mar 29, 2004
    Messages:
    7,484
    Location:
    Lincoln, Nebraska
    Ratings:
    +1,173
    Woah, I really disagree. It's very widely supported and used. I can install modules from CPAN straight from my web host with practically no work on my part. IMDB was just looking for a Perl programmer and Paypal still has the old /cgi-bin/ in their URL (most websites mask it).

    It doesn't generate as much buzz as Ruby on Rails or even PHP but it's still alive and kicking with a large development community.
  11. $corp

    $corp Dirty Old Chinaman

    Joined:
    Mar 29, 2004
    Messages:
    15,867
    Location:
    Calgary, Alberta
    Ratings:
    +7,101
    Well Zenow, I tried that PHP in Flash 4, and it didn't work. The part I am missing is the part where you have to put in an actionscript for after the message is sent, it says "thank you for your comments." There is no OnClipevent command in Flash 4, but I was thinking that really, it should still work, only it won't give you a message that the comment has been sent. I installed it into Flash, and when I hit send, I can see it contacting my web host, but it would get stuck there.

    This is something I'll have to deal with in a few days. I've got to finish a client's designs before my meeting tomorrow, then take it to the print shop and print out some samples.
  12. Zenow

    Zenow Treehugger

    Joined:
    Mar 28, 2004
    Messages:
    4,081
    Location:
    Netherlands
    Ratings:
    +897
    if you're doing this for clients, you really can't use Flash 4 anymore, it's obsolete. We've had Flash 5, Flash MX, Flash 8 and Flash CS3 since then. How about an upgrade? I think you should even worry about backward compatibility in flash player software.