title: As3 email forms php with components
body: <p>I need to create an email form with AS3. Coming from AS2 my knowledge is limited. On stage, i have a submit button, a combobox, and two textinput fields for email and  password. Reading throught some tutorials i know how to send the variables email and password to the mysql database. My question is, in the form i have populated a combobox with some data. How can i send that piece of data to my DB?
  I show you my code to see sorry its rather long but if you can help that be great!</p>
  
  <pre><code>//Building the variables
  var phpVars:URLVariables = new URLVariables();
  
  //Requesting the php file
  var phpFileRequest:URLRequest = new URLRequest("php.file");
  phpFileRequest.method = URLRequestMethod.POST;
  
   phpFileRequest.data = phpVars;
  
   //Building the loader
   var phpLoader:URLLoader = new URLLoader();
  
   phpLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
  
   //Variables ready for the processing
   phpVars.email = email.text;
   phpVars.password = password.text;
  
  btn_one.addEventListener(MouseEvent.CLICK, btnHandler);
  
   //Validate form fields
   function btnHandler(event:MouseEvent):void{
      statusTxt.text =  "" + event.target.data.systemResult;
      trace(event.target.data.systemResult);
  </code></pre>
  
  <p>}</p>
  
  <pre><code>    var statusTxt:TextField = new TextField();
      statusTxt.x = 160.00;
      statusTxt.y = 9.80;
      statusTxt.width = 241.95;
      statusTxt.height = 22.75;
      statusTxt.text = "Please fill out the form below";
      addChild(statusTxt);
  
      //Wanting to add this combobox to my db
         var persons:Array = new Array();
      persons[0] = "Male";
      persons[1] = "Female";
  
     combo_box.dataProvider = new DataProvider(persons);
     combo_box.addEventListener(Event.CHANGE, dataHandler);
  
     function dataHandler(e:Event):void{
        trace(e.target.value);
    }
  </code></pre>