5 Replies Latest reply on Nov 22, 2006 6:07 AM by Newsgroup_User

    load and send, event keyframe

    gilco123
      hi,

      I am trying to send information to the PHP script that work fine without getting any information back and not opening a explorar window.
      I am using sendandload(), and my PHP script return nothing.
      I want it to happen while the swf movie is running, in frame 3, (no pressing a button)

      I wrote the script :
      var result_lv:LoadVars = new LoadVars();
      result_lv.onLoad = function (success:Boolean) {
      if (success) {
      } else {
      result_ta.text = "Error connecting to server.";
      }
      };
      var my_lv:LoadVars = new LoadVars();
      my_lv.fn = "example";
      my_lv.sendAndLoad(" http://www.bananafilm.com/stats/statsscript/stat_loger.php", result_lv, "POST");

      I know it is missing an object, but how I can refer it to the keyframe event.
      please help
      me.
        • 1. Re: load and send, event keyframe
          Level 7
          You need to return something, anything with your script. Even if it's just
          success=true

          JG



          "gilco123" <webforumsuser@macromedia.com> wrote in message
          news:ejnokk$1m9$1@forums.macromedia.com...
          > hi,
          >
          > I am trying to send information to the PHP script that work fine without
          > getting any information back and not opening a explorar window.
          > I am using sendandload(), and my PHP script return nothing.
          > I want it to happen while the swf movie is running, in frame 3, (no
          > pressing a
          > button)
          >
          > I wrote the script :
          > var result_lv:LoadVars = new LoadVars();
          > result_lv.onLoad = function (success:Boolean) {
          > if (success) {
          > } else {
          > result_ta.text = "Error connecting to server.";
          > }
          > };
          > var my_lv:LoadVars = new LoadVars();
          > my_lv.fn = "example";
          >
          > my_lv.sendAndLoad(" http://www.bananafilm.com/stats/statsscript/stat_loger.php",
          > result_lv, "POST");
          >
          > I know it is missing an object, but how I can refer it to the keyframe
          > event.
          > please help
          > me.
          >


          • 2. Re: load and send, event keyframe
            gilco123 Level 1
            I added a return true to the PHP file, and it dont work.
            It just look like the FLASH file dont even start the function to try
            to send and load any parameters.
            so I am still lost here.
            Gilco123
            • 3. Re: load and send, event keyframe
              Level 7
              Gilco,

              I am not sure what's going on, the sendAndLoad you have looks fine, there is
              nothing wrong with it, but I try your PHP script and nothing comes back.
              Maybe you should go back to your PHP create a simple form and test it in
              cases where you send empty variables, no variables at all to see how it
              reacts, once your scripts works the way it should go back to flash.

              Right now if I load your URL straight in the browser I get:

              Notice: Undefined variable: fn in
              /home/qwfkeff/public_html/stats/statsscript/stat_loger.php on line 4

              Notice: Undefined variable: fn in
              /home/qwfkeff/public_html/stats/statsscript/stat_loger.php on line 5

              Notice: Undefined variable: handler in
              /home/qwfkeff/public_html/stats/statsscript/stat_loger.php on line 19

              Notice: Undefined variable: handler in
              /home/qwfkeff/public_html/stats/statsscript/stat_loger.php on line 25

              And if I create an HTML form, and POST to your PHP script, I get nothing
              (blank page).

              Try to deactivate all the error warnings, and notices and have it load
              something. Or set up a text file, like
              http://www.bananafilm.com/stats/statsscript/stat_loger.txt with success=true
              inside of it, and see if you can at least load that in flash. If you can,
              then focus on your PHP.

              JG



              "gilco123" <webforumsuser@macromedia.com> wrote in message
              news:ejpqsk$9r6$1@forums.macromedia.com...
              >I added a return true to the PHP file, and it dont work.
              > It just look like the FLASH file dont even start the function to try
              > to send and load any parameters.
              > so I am still lost here.
              > Gilco123


              • 4. Re: load and send, event keyframe
                gilco123 Level 1
                FOUND THE PROBLEM, THE SITE DONT SUPPORT SWF Request from
                some reason I dont know yet...

                JG
                Thanks for you time...
                The PHP dont suppose to return anything except from TRUE, and it work fine when u insert the 'example' variable to it...maybe I played with it while u tried to run it, I was trying anything I could.
                When I found it problem, after days, I went crazy.... I tried the PHP on a freind
                site (that use other hosting company) and it work fine... I had it wright from the frist day ?!?!@$@#?!#!?@#?!@$?!$
                So thanks again.
                Gil


                • 5. Re: load and send, event keyframe
                  Level 7
                  That's crazy.... Well, maybe you can switch your loadvars from POST to
                  GET. I mean, if your flash is able to load external SWF or jpeg from the
                  server then the server is allowing the SWF to make GET requests, so with
                  the loadvars you will just have a query string at the end of the GET...

                  JG


                  gilco123 wrote:
                  > FOUND THE PROBLEM, THE SITE DONT SUPPORT SWF Request from
                  > some reason I dont know yet...
                  >
                  > JG
                  > Thanks for you time...
                  > The PHP dont suppose to return anything except from TRUE, and it work fine
                  > when u insert the 'example' variable to it...maybe I played with it while u
                  > tried to run it, I was trying anything I could.
                  > When I found it problem, after days, I went crazy.... I tried the PHP on a
                  > freind
                  > site (that use other hosting company) and it work fine... I had it wright
                  > from the frist day ?!?!@$@#?!#!?@#?!@$?!$
                  > So thanks again.
                  > Gil
                  >
                  >
                  >
                  >