2 Replies Latest reply on Oct 15, 2010 3:31 AM by Sect46

    Flash to PHP Help

    Gu55tav

      Hi There,

       

      I have a button which advances a movie to a certain frame as long as the correct password has been entered. This works fine.

       

      I also need the button to send variable data from user input data to PHP. I cant get this part to work.

       

      Can anyone help me with my code below?

       

      Cheers

       

       

       

       

      stop();

       

      var myPassword:String = 'cusick';
      nextbtn.onRelease = function() {
          if (password_txt.text == myPassword) {
              gotoAndPlay(49);
          if(Name.text!="" && Email.text !=""){
              myData.Name = Name.text
              myData.Email = Email.text
              myData.sendAndLoad("save.php", myData, "POST") //php
              //myData.sendAndLoad("save.asp", myData, "POST") //asp
              //myData.sendAndLoad("save.cfm", myData, "POST") //cf
         
      myData = new LoadVars()
      myData.onLoad = function(){
      }
      }
          } else {
              gotoAndStop(48);
          }
      };

        • 1. Re: Flash to PHP Help
          Ned Murphy Adobe Community Professional & MVP

          You need to declare the LoadVars object before you try to utilize it.

           

          stop();

           

          var myPassword:String = 'cusick';
          nextbtn.onRelease = function() {
              if (password_txt.text == myPassword) {
                  gotoAndPlay(49);
              if(Name.text!="" && Email.text !=""){

                  var myData = new LoadVars();
                  myData.Name = Name.text
                  myData.Email = Email.text
                  myData.sendAndLoad("save.php", myData, "POST") //php
                  //myData.sendAndLoad("save.asp", myData, "POST") //asp
                  //myData.sendAndLoad("save.cfm", myData, "POST") //cf
             
          myData.onLoad = function(){
          }
          }
              } else {
                  gotoAndStop(48);
              }
          };

          1 person found this helpful
          • 2. Re: Flash to PHP Help
            Sect46

            I suggest you spend a little time learning about how scope works in Actionscript. It will help you understand a little more about nesting and variables. (http://www.kirupa.com/developer/actionscript/tricks/scope.htm)