7 Replies Latest reply on Dec 20, 2007 11:43 AM by migduvednok

    emailform AS wrong

    migduvednok Level 1
      the fla is here

      im trying to make an email script, but somehow the AS is wrong. At one time i could get it to work, but the resulting email has some STRANGE code in it... now i can't even get the form to send an email! :-D

      Somehow my fla AS is wrong - can you help me to solve the problem, please?
        • 1. Re: emailform AS wrong
          kglad Adobe Community Professional & MVP
          check flashgods.org. there's a sample of code to submit form data using as2 (and as3).
          • 2. Re: emailform AS wrong
            migduvednok Level 1
            so sorry, but my task is to find the error in my current script, not needing to rewrite the whole thing for that would not be neccessary at all.
            • 3. Re: emailform AS wrong
              robdillon Most Valuable Participant
              You really do want to look at that example file. What you are currently doing has many problems. You are using Actionscript 1 methods, you really should be writing the actionscript to frame spaces and not directly on to the button objects. Using loadVariables() doesn't discriminate which variables it sends. It is really intended to bring data TO a Flash movie, not send it out.

              You want to use the LoadVars() method. This allows you to select the text that you want to send and to more accurately specify the variable name that you are sending with the value string. Using sendAndLoad() you can further check to see that the data was recieved and show the user a result, if you like.

              You might also want to do a search in this forum for "sendAndLoad". You'll find lots of additional information on sending data from a Flash movie.
              • 4. Re: emailform AS wrong
                migduvednok Level 1
                Somehow what i did before with old methods WORKED. However, i recognize that i use old methods because im horrible at AS and merely copy scripts from project to project and adjust them - thus they begin to outdate. (or use bought components)

                However, i have now tried to follow the instruction on flashgods but to little avail. Attached are the php and the new code. Would you please be kind to look it over for me? Here are the files Thank you so much for your effort so far, it means lots. :-)
                • 5. Re: emailform AS wrong
                  migduvednok Level 1
                  • 6. Re: emailform AS wrong
                    robdillon Most Valuable Participant
                    What you have is pretty much correct. However, to properly test this, you need to mount both the .swf and the .php files on your server. You will also need to use a full URL to the .php file.

                    You might also want to tidy up that code that you have still attached to the button itself. You want to be sure that you don't have conflicting events.
                    • 7. Re: emailform AS wrong
                      migduvednok Level 1
                      Im grateful for Your time, Rob, but this is not working: not using full URL, not removing the commented code, not anything. (i has already uploaded the php to the server)

                      damn shame, gotta figure something else out.