28 Replies Latest reply on Feb 1, 2008 7:31 AM by kglad

    Email 'hangs' endlessly

    SteveH59 Level 1
      Hello

      I have a Flash site with a contact form on it.

      When the user completes the information and presses 'Submit' the email is received and formatted correctly.

      But on pressing 'Submit' it hangs endlessly (although it is being sent/has been sent).

      What is likely to be the problem, please? And how do I get rid of that icon over the email form? You can see a screenshot of it here:

      http://www11.brinkster.com/stevehigham/hanging.html

      Many thanks.

      Steve

        • 1. Re: Email 'hangs' endlessly
          kglad Adobe Community Professional & MVP
          what code do you have in your back-end sending the email and what's in flash receiving acknowledgment that the email has been sent?
          • 2. Re: Email 'hangs' endlessly
            SteveH59 Level 1
            Hello

            Thank you for your reply.

            This is my Actions Script (MX 2004).

            var mainTL:MovieClip = this;

            submit_mc._alpha = 80;

            var dataSender:LoadVars = new LoadVars();

            var dataReceiver:LoadVars = new LoadVars();

            /*create listener for Key Object to 'wakes up' the submit button when fields completed*/

            var formCheck:Object = new Object();
            formCheck.onKeyUp = function() {
            if (name_txt.text != '' &&
            email_txt.text != '' &&
            business_txt.text != '' &&
            country_txt.text != '' &&
            message_txt.text != '') {
            //clear any alert messages
            alert_txt.text = '';
            //enable the submit button
            submit_mc._alpha = 100;
            } else {
            //remain disabled until all fields have content
            submit_mc._alpha = 80;
            }
            }

            Key.addListener(formCheck);

            Selection.setFocus(name_txt);

            /*DEFINE SUBMIT BUTTON BEHAVIOR*/

            submit_mc.onRelease = function() {
            //final check to make sure fields are completed
            if (name_txt.text != '' &&
            email_txt.text != '' &&
            business_txt.text != '' &&
            country_txt.text != '' &&
            message_txt.text != '') {
            alert_txt.text='';

            //clear any previous error messages or warnings
            //advance playhead to frame 2 - the "processing" message

            mainTL.play();
            //assign properties to LoadVars object created previously
            dataSender.name = name_txt.text;
            dataSender.email = email_txt.text;
            dataSender.business = business_txt.text;
            dataSender.country = country_txt.text;
            dataSender.message = message_txt.text;
            //callback function - handling what comes back
            dataReceiver.onLoad = function() {
            if (this.response == "invalid") {
            mainTL.gotoAndStop(1);
            alert_txt.text = "Sorry, but your email address appears invalid"
            } else if (this.response == "passed") {
            mainTL.gotoAndStop(4);
            }
            }
            //now send data to script

            dataSender.sendAndLoad("flash.asp", dataReceiver, "POST");
            } else {
            //if fields are incomplete
            alert_txt.text = "Please complete all fields";
            }
            }

            I also use variables – defined in the Properties panel: name, email, business, country, message and it is these variables which the ASP file gets (not the instance names).

            The relevant part of the ASP script is as follows:

            <%
            Dim name,email,business,country,message

            name = Request.Form("name")
            email = Request.Form("email")
            business = Request.Form("business")
            country = Request.Form("country")
            message = Request.Form("message")

            'Open MS Access database, store form field values, and close

            Is there anything you can see here which might be causing this ‘hanging’ problem?

            If you wish to see it for yourself and fill in the form, it is here:

            http://stevehigham59.7host.com/ASPflash/graphic9reASP.html

            (please click on ‘Contact’) to reach the form.

            Many thanks again for your time.

            Steve
            • 3. Re: Email 'hangs' endlessly
              kglad Adobe Community Professional & MVP
              i don't see your asp script returning a "response" variable. and your asp code is incomplete.

              copy and paste your asp code using the attach code option.
              • 4. Re: Email 'hangs' endlessly
                SteveH59 Level 1
                Hello kglad

                Here is the asp code (the relevant part, at least).

                As I say, emails are received from the site, but 'hang' endlessly.

                Thanks again for your timee.

                Steve

                • 5. Re: Email 'hangs' endlessly
                  kglad Adobe Community Professional & MVP
                  is dataReceiver.onLoad receiving a "response" variable?
                  • 6. Re: Email 'hangs' endlessly
                    SteveH59 Level 1
                    Hello kglad

                    If not all form fields are completed before the submit button is pressed, the user gets an error message. But if you mean does the server send a message back to the dynamic text field in my Flash form saying 'email sent' or 'email failed' then, no, I get nothing back.

                    It hangs at the 'Processing email' stage.

                    What would you recommend, if anything?

                    Cheers

                    Steve
                    • 7. Re: Email 'hangs' endlessly
                      SteveH59 Level 1
                      Hello kglad.

                      I think if the ASP file processes the request to send email (and HTML formats it) and stores field information into the database, the script itself, in principle, is working. But it appears to stall.

                      I downloaded and intergrated the form into my own site, keeping the original structure (layers, AS script, etc), but I have not used the PHP script which came with it. With the PHP script, the form is sent instantly.

                      However, I do not know PHP and, in any case, my ASP script has more to do than the original PHP script. Even so, the processing time difference between the two should hardly be noticeable.

                      The issue, then, is this: why does the ASP script work - in that it does everything I ask of it - yet Flash tells me it is still processing my request?

                      The FLA file (both the original and my own) has seven layers, some with AS on them. I am happy to send you my version if you think this would help, but I am unsure how I would post the files here (it's a whopping 10MB!!).

                      Many thanks for your input into this, kglad.

                      Steve
                      • 8. Re: Email 'hangs' endlessly
                        kglad Adobe Community Professional & MVP
                        where's the code in your asp file that's returning a variable/value pair to flash?
                        • 9. Re: Email 'hangs' endlessly
                          SteveH59 Level 1
                          Hello kglad

                          There is nothing in my ASP file that returns anything to flash. I have a few layers in my FLA file which show me my designed form in frame 1, the 'processing request' in frame 2, a 'system error - please try again' in frame 3, and a 'message sent' in frame 4.

                          My Action Script shows:

                          var dataReceiver:LoadVars = new LoadVars();

                          which should receive what comes back, but you are saying that nothing comes back from ASP, aren't you?

                          I am not sure how I would write that. In ASP would it be a Response.Write statement which is somehow sent back to my FLA file in order to generate either the 'system error - please try again' message, or the 'message sent'?

                          Many thanks again for the trouble you have taken over this.

                          Steve
                          • 10. Re: Email 'hangs' endlessly
                            kglad Adobe Community Professional & MVP
                            your onLoad method is expecting to receive a variable named response with value "passed" or "invalid".
                            • 11. Re: Email 'hangs' endlessly
                              SteveH59 Level 1
                              Hello kglad

                              I have added this to my asp file towards the bottom of my script, but it still hangs, unfortunately:

                              On Error resume next

                              If Err.Number <> 0 then

                              Response.Write "&server_mes=fail"

                              Response.End

                              else

                              Response.Write "&server_mes=ok"

                              End if

                              myMail.Send
                              set myMail=nothing
                              %>

                              I have not changed anything in my Action Script.

                              Steve

                              • 12. Re: Email 'hangs' endlessly
                                kglad Adobe Community Professional & MVP
                                and is your onLoad method receiving anything?
                                • 13. Re: Email 'hangs' endlessly
                                  SteveH59 Level 1
                                  Hello Kglad

                                  Thanks again for your post.

                                  I have reflected in my ASP code what the Action Script is expecting:

                                  On Error resume next

                                  'If any errors were encounter then run this code

                                  If Err.Number <> 0 then
                                  Response.Write "&output=invalid"
                                  Response.End
                                  else
                                  Response.Write "&output=passed"
                                  End if

                                  I have also been spending some time on the email/asp side of things.

                                  What I have now is this: the email is sent to the inbox. It is correctly formatted. the field data from the Flash form is stored into my database.

                                  But the Flash form still hangs. It hangs endlessly, not for a few minutes or so.

                                  It would seem that the ASP side of things works fine so I know what the problem is NOT, but the onLoad method, as you say, is not receiving anything. If there is a server/ASP problem, Flash should tell me: system error. And if the message is sent (and as I say it is, eventually, received in my inbox), Flash should tell me 'Message sent'.

                                  The problem has to lie in the Flash fla file, don't you think?

                                  Many thanks for your time.

                                  Steve

                                  Text
                                  • 14. Re: Email 'hangs' endlessly
                                    kglad Adobe Community Professional & MVP
                                    if your onLoad method is not receiving anything, the problem is your asp file failing to send anything back to flash.

                                    what happens when you use:

                                    • 15. Re: Email 'hangs' endlessly
                                      SteveH59 Level 1
                                      Hello kglad

                                      I'll try copying and pasting your script into my AS panel in my Fla file (I presume I do not need to delete anything that I have there already), upload the file again and let you know.

                                      Many thanks for your patience!

                                      Steve
                                      • 16. Re: Email 'hangs' endlessly
                                        kglad Adobe Community Professional & MVP
                                        you need to comment out your current dataReiver.onLoad method.
                                        • 17. Re: Email 'hangs' endlessly
                                          SteveH59 Level 1
                                          Hello kGlad

                                          This is what I now have in my Actions Panel after commenting out the dataReceiver.onLoad as follows:

                                          //dataReceiver.onLoad = function() {
                                          //if (this.response == "invalid") {
                                          //mainTL.gotoAndStop(1);
                                          //alert_txt.text = "Sorry, but your email address appears invalid"
                                          //} else if (this.response == "passed") {
                                          //mainTL.gotoAndStop(4);
                                          //}
                                          //}


                                          //send data to ASP
                                          dataSender.sendAndLoad("flash.asp", dataReceiver, "POST");
                                          } else
                                          {

                                          //if fields are incomplete
                                          alert_txt.text = "Please complete all fields";
                                          }
                                          }


                                          dataReceiver.onLoad = function() {
                                          trace("sent");
                                          for(var d:String in this){
                                          trace(d+": "+this[d]);
                                          }

                                          I have uploaded everything onto the server and completed the online form. The email is received in my inbox and stored in the database, but still hangs endlessly.

                                          I do not get any message, at all, from the server. All my Flash site shows, after pressing the 'submit' button is what it has always showed: 'processing request......................'

                                          What do you think the root of the problem might be?

                                          Thanks again.

                                          Steve
                                          • 18. Re: Email 'hangs' endlessly
                                            kglad Adobe Community Professional & MVP
                                            are you using firefox and flashtracer so you can see trace() output in your browser?
                                            • 19. Re: Email 'hangs' endlessly
                                              SteveH59 Level 1
                                              Hello kglad

                                              I've downloaded firefox and the tracer add-on. Then gone to my server, opened up the Flash file, completed the form and pressed submit. I can't see any sidebar, though I have checked it in 'View' in Firefox and pressed ALT + A.

                                              At the bottom of the page I can see: 'Transferring data from................etc.

                                              Is that what you mean?

                                              Steve

                                              • 20. Re: Email 'hangs' endlessly
                                                kglad Adobe Community Professional & MVP
                                                that's what i mean, but you need to make sure your flashtracer is working. create a test fla that contains nothing but a

                                                trace("HI");

                                                in it. open it in firefox and check your flashtracer window to see if that HI is visible. if it is, your flashtracer is working. otherwise, it's not.
                                                • 21. Re: Email 'hangs' endlessly
                                                  SteveH59 Level 1
                                                  Hello kGlad

                                                  This is a screenshot of what I see:

                                                  http://www11.brinkster.com/stevehigham/Tracer.html

                                                  In Flashtracer there is no movement. Nothing appears in the window.

                                                  OK, so I create an FLA file and in the first frame type trace("HI"); Is that in the Action Script panel?

                                                  Thanks again.

                                                  Steve
                                                  • 22. Re: Email 'hangs' endlessly
                                                    kglad Adobe Community Professional & MVP
                                                    i understand that. the question is, are you seeing nothing because there is no trace() output (which means your php script is returning nothing to flash) or is that because you have failed to setup flashtracer correctly.

                                                    to find which, create a fla with a trace() function that you know will execute, open it in your browser and see if your flashtracer revealed that trace() output. if yes, the problem is your php file. if no, you haven't setup flashtracer correctly: you may need a debug flash player plugin or you may need to setup your flashlog.txt path or something else.
                                                    • 23. Re: Email 'hangs' endlessly
                                                      SteveH59 Level 1
                                                      Hello kglad

                                                      The tracer sidebar is just blank. I'll try installing it again and repeating the exercise.

                                                      Thanks for your patience!

                                                      Steve
                                                      • 24. Re: Email 'hangs' endlessly
                                                        SteveH59 Level 1
                                                        I have reinstalled it and opened it as a large panel on the left hand side of the Firefox browser. Completed the form again and pressed submit. It just says 'transferring data....' And continues to say it.

                                                        I have just tested exactly the same ASP script with another FLA file here:

                                                        http://stevehigham59.7host.com/feedback2/feedback2.html

                                                        and the Flash site works fine (I still see nothing in the tracer).

                                                        The email is sent and received, stored in the database, and Flash displays a 'Thank you'.

                                                        This does not happen with the file we are discussing. Doesn't this imply something wrong with the Flash/ActionScript side of things?

                                                        Thanks again.

                                                        Steve
                                                        • 25. Re: Email 'hangs' endlessly
                                                          kglad Adobe Community Professional & MVP
                                                          no, it doesn't. your asp file may not be sending data back to flash.

                                                          first, are you certain you have a flash player DEBUG version? if not, install it. 2nd, open the flashtracer options and navigate to your flashlog.txt file in the "select output file" window. now, retest using a simple swf that you know is executing a trace("whatever") statement.

                                                          once you have flashtracer working, you can test your file.
                                                          • 26. Re: Email 'hangs' endlessly
                                                            kglad Adobe Community Professional & MVP
                                                            p.s. i just went to your 1/31/08 message link and tried sending email with my (working) flashtracer open and the email was sent successfully and i saw no hang: i received the email and i saw a "thank you, your message was successfully sent" screen.
                                                            • 27. Re: Email 'hangs' endlessly
                                                              SteveH59 Level 1
                                                              Hello kglad

                                                              The link that works is not the one I am having trouble with. I took the asp code from this link that works and used it with that fla whih does not work, just to assure myself it was not the asp code. But as it makes no difference - the email still hangs despite this asp code which works on the form you visited - I thought the problem might lie in the Action Script/Flash side of things, as I mentioned.

                                                              I have installed the debug version and set up the flash txt log. I still can't see a trace.

                                                              I'm beginning to think I should go back to the drawing board on this one!

                                                              Many thanks for all your help.

                                                              Steve
                                                              • 28. Re: Email 'hangs' endlessly
                                                                kglad Adobe Community Professional & MVP
                                                                once you have the debug version the problem is flashlog.txt file. if you're using windows open flashtracer, click the options button, click the browse button (to select output file) and navigate to C:\Documents and Settings\{your name}\Application Data\Macromedia\Flash Player\Logs\flashlog.txt.

                                                                if there is no Logs directory, create one. if there is no flashlog.txt file, create one (with nothing in it). retest with swf that's known to contain a trace() statement that always executes.