Welcome to TalkGraphics.com
Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Apr 2001
    Location
    Northern Ireland
    Posts
    788

    Default

    So far...

    1) I built a form.
    2) I created the 'hidden' variables as good old vars
    eg:

    submit_to = "me@my_address.com";

    3) I created a variable input box and gave it a name.

    4) Then I added a submit button with the action:

    on (release) { getURL("../cgi-bin/my_mail_form.cgi","_blank","POST");

    But the mail form does not seem to receive any variables??

    Everything I read on the help pages and web seems to indicate that Flash will send all variables set in the movie to the cgi script - but it does not seem to see any :-(

    The script has all the right permissions and works, becase my old HTML page uses the cgi just fine.

    Is there something that I'm missing?

    Turan

    PS the script is being called - so it is finding it, but the lines that check the fields have been filled out are being displayed eg: 'No submit_to value entered'
    IP

  2. #2
    Join Date
    Apr 2001
    Location
    Northern Ireland
    Posts
    788

    Default

    So far...

    1) I built a form.
    2) I created the 'hidden' variables as good old vars
    eg:

    submit_to = "me@my_address.com";

    3) I created a variable input box and gave it a name.

    4) Then I added a submit button with the action:

    on (release) { getURL("../cgi-bin/my_mail_form.cgi","_blank","POST");

    But the mail form does not seem to receive any variables??

    Everything I read on the help pages and web seems to indicate that Flash will send all variables set in the movie to the cgi script - but it does not seem to see any :-(

    The script has all the right permissions and works, becase my old HTML page uses the cgi just fine.

    Is there something that I'm missing?

    Turan

    PS the script is being called - so it is finding it, but the lines that check the fields have been filled out are being displayed eg: 'No submit_to value entered'
    IP

  3. #3
    Join Date
    Dec 2000
    Location
    andalucía · españa and lower saxony · germany
    Posts
    2,125

    Default

    <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR> on (release) { getURL("../cgi-bin/my_mail_form.cgi","_blank","POST"); <HR></BLOCKQUOTE>

    A clean form would look like this:

    On (Roll Over)
    Begin Tell Target ("mailer interactive01")
    Go to and Stop (3)
    End Tell Target
    End On
    On (Press)
    If (email eq "")
    Begin Tell Target ("mailer interactive01")
    Go to and Stop (4)
    End Tell Target
    Else
    Set Variable: "param_recipient" = "your_mail_account@your_server.com"
    Set Variable: "param_subject" = "message from whatever"
    Set Variable: "param_order" = "name,email,message"
    Set Variable: "param_database" = "flash_yourfilename.txt"
    Get URL ("http://your_server.com/cgi-bin/your_forms.cgi", window="_blank", vars=POST)
    Play
    End If
    End On
    On (Roll Out)
    Begin Tell Target ("mailer interactive01")
    Go to and Stop (1)
    End Tell Target
    End On

    But this is only part of it. Keep in mind that you need to "collect" your data first, that means the variables you have specified start at the beginning of the scene and stay until the last frame of the scene.

    OK, let's say the users have to fill in 'name'. The name variable MUST exist until you trigger the form data to be sent to your cgi. Many people clear the data of the variables too soon, that means you should give some 10 frames extra after triggering the data, because of the delay while the browser opens up.

    In addition you need a JavaScript that enables your FLASH to open up a new window in your browser (but only for online forms, not for offline forms).

    It's very tricky, I know, but I hope this helps a bit.

    jens g.r. benthien
    designer
    http://www.sacalobra.de

    ----------//--
    If you don't know how to dream you'll never be a designer.
    ----------//--
    --------------------//--
    We can't solve problems by using the same kind of thinking we used when we created them.
    --------------------//--
    IP

  4. #4
    Join Date
    Apr 2001
    Location
    Northern Ireland
    Posts
    788

    Default

    Thanks for the info.

    Not sure I understand it all so here goes:

    your saying,

    If the form is in an MC the getURL can't be in the last frame i.e. there should be several frames after it to allow the getURL (and I guess really that means the POST operation) to execute. Otherwise the variables die and dissappear when the MC ends and returns to the main timeline. Hence when the script starts running the MC is already over and no variables exist for the script to access.

    ?

    Turan
    IP

  5. #5
    Join Date
    Dec 2000
    Location
    andalucía · españa and lower saxony · germany
    Posts
    2,125

    Default

    <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR> Hence when the script starts running the MC is already over and no variables exist for the script to access. <HR></BLOCKQUOTE>

    Correct. That's exactly the problem. Place the trigger (get URL...) into the MC and extend the MC for 10 frames, this should work.

    Build it like for example this:

    your MC for the form is running, then stops. You have a button (on release) with your variables at the stop key. As soon as you click the button you send your variables as in the sample, and in addition you say: play -> so the MC will continue to play for at least 10 additional frames. Then it can be closed and FLASH will return to level_0 - the main timeline.

    Don't forget to reset all variables at the very first frame of the MC - otherwise if someone will re-run or re-start the MC the old values will appear in the variable fields.

    Let me know if this works for you

    jens g.r. benthien
    designer
    http://www.sacalobra.de

    ----------//--
    If you don't know how to dream you'll never be a designer.
    ----------//--
    --------------------//--
    We can't solve problems by using the same kind of thinking we used when we created them.
    --------------------//--
    IP

  6. #6
    Join Date
    Apr 2001
    Location
    Northern Ireland
    Posts
    788

    Default

    no joy

    I'm getting to the point were I'll have to call an html page with the form in it - but it will spoil the look of the flash site.

    I've changed from getURL to loadvars.send and created a 100 frame delay. but nothing

    The script is being called from FLASH so I know I'm very close. I know the script works when called from HTML so I know it is not something about the host machine sending data to the cgi script. I just can't seem to get the variables out of FLASH and into the script.

    Any suggestions?

    Turan
    IP

  7. #7
    Join Date
    Apr 2001
    Location
    Northern Ireland
    Posts
    788

    Default

    I tries this:

    form_id = "FORM_CONTACT";
    myLoadVars = new LoadVars();
    myLoadVars.send("../cgi-bin/test.txt");

    Hoping that the form_id variable would be sent to a file called test.txt.

    But this does not work either.

    Can anyone tell me if there is anything wrong with this script?

    I was hoping I could get somewhere if I could just send a variable out of FLASH into a file!

    Turan
    IP

  8. #8
    Join Date
    Dec 2000
    Location
    andalucía · españa and lower saxony · germany
    Posts
    2,125

    Default

    <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>I tries this:

    form_id = "FORM_CONTACT";
    myLoadVars = new LoadVars();
    myLoadVars.send("../cgi-bin/test.txt");

    Hoping that the form_id variable would be sent to a file called test.txt.

    But this does not work either.

    Can anyone tell me if there is anything wrong with this script?

    I was hoping I could get somewhere if I could just send a variable out of FLASH into a file!

    Turan<HR></BLOCKQUOTE>

    huh. That's tough. Which FLASH version are you using? If it's 4 or 5, I can continue to help.

    How do you know that the cgi does receive your data?

    Something else: I guess you've transferred your *.cgi via ftp to the server. This **must** be done as a textfile, not as binaries or anything else.

    Once on the server - provided that the cgi actually does receive the data - you should do a chmod. Either with your ftp if it can handle these commands, or with telnet or you should ask your provider.

    chmod 755 my_form.cgi

    or whatever your cgi name will be.

    Reason: the file on the server must be able to read and write. Usually all files transfered to your server's cgi-bin are not 755 or 777, so they can't write - which they must if you need an output, because the cgi will send the data to the mail server.

    Did you check the path to your cgi? Some providers don't disclose it, so /mydomain.com/cgi-bin is not always true. In addition you need to know where your sendmail is located on the server.

    I'll attach a 'helper' cgi for you to check your server. Instructions are included.

    jens

    jens g.r. benthien
    designer
    http://www.sacalobra.de

    ----------//--
    If you don't know how to dream you'll never be a designer.
    ----------//--
    Attached Files Attached Files
    --------------------//--
    We can't solve problems by using the same kind of thinking we used when we created them.
    --------------------//--
    IP

  9. #9
    Join Date
    Dec 2000
    Location
    andalucía · españa and lower saxony · germany
    Posts
    2,125

    Default

    here is another cgi to control your server.

    upload it to your cgi-bin directory, open it with your browser -> http://your_domain.com/cgi-bin/genie.cgi

    go to the 'command line' and issue the chmod commands as posted above. Don't forget to close the window.

    jens

    jens g.r. benthien
    designer
    http://www.sacalobra.de

    ----------//--
    If you don't know how to dream you'll never be a designer.
    ----------//--
    Attached Files Attached Files
    --------------------//--
    We can't solve problems by using the same kind of thinking we used when we created them.
    --------------------//--
    IP

  10. #10
    Join Date
    Apr 2001
    Location
    Northern Ireland
    Posts
    788

    Default

    The cgi runs fine. If I call it from an HTML page. It works and receives all data required.

    The cgi is called also from flash. However there is a data_required variable that I send to the cgi script. It lists what the user must enter (leaving out what is optional).

    The script runs ok, but when it gets to the point were it checks this variable it outputs to the _blank window that that variable is not set! Hence in giving me a run time error I know it is running!!

    So I know the cgi is working that the permission have been set etc (becase (a) it runs when called frmo HTML and (b) that it also runs when called from FLASH, but it just does not recevie the variables.

    Check out www.sldi.co.uk/new.htm (click on contact)as you can see I resorted for now to the html form but I really wanted a FLASH form.

    If you look at the current (non-flash) site www.sldi.co.uk you will see that the form works fine there.

    Turan
    IP

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •