3 Replies Latest reply on Jun 24, 2010 6:20 AM by kglad

    Re-build HTML Form in Flash?

    SpeedChimp

      Hi
      Wonder if someone can help. Please excuse my incompetence, I am fairly new to Flash / Actionscript
      Basically I am trying to re-build this simple HTML form in Flash, I have not shown the actual URL here, but this is a functioning form when the correct URL is in place:
      <form action="http://www.customersURLhere/" method="post">
        <input type="text" name="vrm"/>
        <input type="submit" value="go"/>
        <input type="hidden" name="update" value="false"/>
        <input type="hidden" name="source" value="aexp"/>
        <input type="hidden" name="supplier" value="AEMP" />
      </form>
      I have attempted to re-build this in flash. I have 1 text input field which I have set the variable name to 'vrm' to match the input field above. I then created a basic flash button and set the following action:
      on (release) {
      update = "false";
      source = "aexp";
      supplier = "AEMP";
      getURL ("http://www.customersURLhere", "", "POST");
      }
      Can anyone spot any obvious errors???
      Any help would really be appreciated.

        • 1. Re: Re-build HTML Form in Flash?
          kglad Adobe Community Professional & MVP

          use:

           

          var sendLV:LoadVars=new LoadVars();

          var receiveLV:LoadVars=new LoadVars();

          receiveLV.onData=function(src){

          //do whatever

          }

          sendLV.update=false;

          sendLV.source="aexp";

          sendLV.supplier="AEMP";

           

          submitBtn.onRelease=function(){

          sendLV.vrm=vrm;

          sendLV.sendAndLoad(localpathtoserversidescript,receiveLV,"POST");

          }

          • 2. Re: Re-build HTML Form in Flash?
            SpeedChimp Level 1

            Thanks for your help.

             

            Unfortunately I am still struggling to get this to work.

             

            I have applied your script to the button, is that correct? (The button is on it's own layer and has one keyframe at the start or the movie.)

             

            Do I need to label/name the button 'submitBtn' in some way?


            You added a comment '//do whatever'... do I need to add something here?

             

            Sorry, I'm a complete novice!!

            • 3. Re: Re-build HTML Form in Flash?
              kglad Adobe Community Professional & MVP

              you need to assign an instance name to your button (click on the button to select it and in the properties panel, type submitBtn).

               

              the code should be attached to a frame (not object).

               

              and you should so something when the data's successfully submitted and processed to let the user know.