6 Replies Latest reply on Apr 18, 2007 3:27 AM by Greg Dove

    sendAndLoad() stopped working Internet Explorer

    Rob_Fearn
      Has anyone else suddenly had their sendAndLoad() function stop working in Internet Explorer (V6.0.2)? The following code exists in my site and worked about 3 days ago. I have made no changes but now the sendAndLoad function wont work in Internet Explorer but it will still work fine in Firefox (I have checked to make sure neither is cached).

      Add.onPress = function()
      {
      if(name_field.text == "")
      {
      Alert.show("Please complete all required (*) fields","Incomplete Fields",Alert.OK,_root);
      return;
      }

      if(comment_field.text == "")
      {
      Alert.show("Please complete all required (*) fields","Incomplete Fields",Alert.OK,_root);
      return;
      }

      var s:LoadVars = new LoadVars();
      var l:LoadVars = new LoadVars();

      l.onLoad = function(success:Boolean)
      {
      if(success)
      {
      _root.ph.attachMovie("lyrics","lyr1",100);

      _parent.deletePopUp();

      }
      else
      {

      //THIS IS THE WARNING I GET THEREFORE success IS FALSE
      Alert.show("Oops it seems there was a problem adding your entry to the guestbook, please contact me if this problem persists","Failed to add to Guestbook",Alert.OK,_root);
      }
      }

      s.name = name_field.text;
      s.email = email_field.text;
      s.comment = comment_field.text;

      //THIS WORKS FINE
      //s.send("add_to_guestbook.php","_blank","POST");

      //THIS FAILS
      s.sendAndLoad("www.robfearn.com/add_to_guestbook.php",l,"POST");
      }
        • 1. Re: sendAndLoad() stopped working Internet Explorer
          MotionMaker Level 1
          1, Is the proper version of Flash to support the Flash components in IE? Right click over the FLash movie to find out.
          2. Always use http:// for any url in code and so perhaps why www.robfearn.com/add_to_guestbook.php fails.
          3. Did you try this
          s.sendAndLoad("add_to_guestbook.php",l,"POST");
          • 2. sendAndLoad() stopped working Internet Explorer
            Rob_Fearn Level 1
            Thanks for the superfast reply!!

            1, Is the proper version of Flash to support the Flash components in IE? Right click over the FLash movie to find out.

            Yes - I have just updated it from 9.0.2 to 9.0.45 via the Macromedia site, it made no difference

            2. Always use http:// for any url in code and so perhaps why www.robfearn.com/add_to_guestbook.php fails.

            I actually did have http:// in front of it in the code but when I previewed the code for the forum it did some weird "}" thing which I apparantly cant emulate now. lol typical anyway it was there originally when it began to fail.

            3. Did you try this
            s.sendAndLoad("add_to_guestbook.php",l,"POST");

            Yes - I tried that initially and I have just retried it with the updated flash player.

            It looks like the PHP code is firing as the guest book is being updated, however success is not being assigned the value true. Should I be returning "success" as a variable from my PHP code (Below)? it worked without out it before has there been an update?




            <?php

            include_once("DBConnect.inc");

            $name = $_POST["name"];
            $email = $_POST["email"];
            $comment = $_POST["comment"];


            //echo "$name<br><br>$email<br><br>$comment";

            DB_Connect();


            db_query("INSERT INTO guestbook(name,email,comment,stamp) VALUES('$name','$email','$comment',NOW())");


            DB_Close();

            ?>

            • 3. Re: sendAndLoad() stopped working Internet Explorer
              Greg Dove Level 4
              I'm not that familiar with PHP yet, I'm still learning, but is the php script returning anything for the recieving LoadVars object? If not that may be part of the problem (like I said I'm still learning). I notice you had a test echo that you presumably used for testing which may have been 'returning' something until you commented it out. You could explicitly return a variable with something like
              echo "result=ok" perhaps, just to force something into the receiving object.

              And as a FYI, to post code in this forum, use the attach Code button and paste it in the pop-up window. It shoud render your code accurately without 'glitches'.
              • 4. Re: sendAndLoad() stopped working Internet Explorer
                Rob_Fearn Level 1
                All good, YES returning a dummy variable did fix the problem, I am not sure why it has changed, as I said earlier it worked last week and it works on Firefox (which is not my browser of choice, I usually develop under IE).

                Anyway thanks for the suggestions and comments.
                • 5. Re: sendAndLoad() stopped working Internet Explorer
                  Rob_Fearn Level 1
                  All good, YES returning a dummy variable did fix the problem, I am not sure why it has changed, as I said earlier it worked last week and it works on Firefox (which is not my browser of choice, I usually develop under IE).

                  Anyway thanks for the suggestions and comments.