1 Reply Latest reply on Mar 1, 2007 10:01 AM by tonyhigham

    sendAndLoad problems

    perree
      Hello,

      I have developed an online test with 5 sections. Each section is one scene in the Flash movie. I am using Flash 8. At the end of each section there is a button the user presses to go to the next section. The action in the button is:

      on (release) {
      myData2.sendAndLoad("Newprocesstest.asp", myData2, "POST");
      myData2Test.sendAndLoad("GradeTest.asp", myData2Test, "POST");
      _root.gotoAndPlay("StartSection3Intro");
      }

      The first sendAndLoad (Newprocesstest.asp) is executing fine. But, the second one (Gradetest.asp) either doesn't execute at all (in all 5 sections) or it executes inconsistently--ie for one user it executed for sections 1 and 2, but not for the other 3 sections. I don't understand why this is working so inconsistently and only seems to be executing sometimes.

      I have verified the asp file is working correctly as I can run it from a browser manually.

      Any ideas would be much appreciated!
        • 1. sendAndLoad problems
          tonyhigham Level 1
          I use remoting for this sort of thing, so I'm not an expert on sendAndLoad, but generally this sort of inconsistency is due to a synchronicity issue. My guess is that when you make the second sendAndLoad call, the AVM is still busy with the first one, and it gets lost in the shuffle. You could combine the your ASP functions into one page and make one sendAndLoad call, or if thats not an option you could just wait till the first one finished to make the second one. The delay should be very small....

          on (release) {
          myData2.sendAndLoad("Newprocesstest.asp", myData2, "POST");
          }

          myData2.onLoad = function(){
          myData2Test.sendAndLoad("GradeTest.asp", myData2Test, "POST");
          _root.gotoAndPlay("StartSection3Intro");
          }

          Thats the general idea, although you may have to fiddle with the syntax a bit. Hope that helps!