ActionScript for SearchProducts.fla

#include "NetServices.as"
// Connect to the gateway and create a service object
if (connected == null) {
  connected = true;
  NetServices.setDefaultGatewayUrl("http://localhost/flashservices/gateway");
  var my_conn = NetServices.createGatewayConnection();
  var myService = my_conn.getService("com.oreilly.frdg.SearchProducts", this);
}

var simpleListener = new Object();
submit_pb.addEventListener("click", onSubmit);

// Event handler for button
function onSubmit () {
  myService.getSearchResult(search_txt.text);
}
// Responder function for result
function getSearchResult_Result (result_rs) {
  var temp = "";
  temp += "There were " + result_rs.getLength();
  temp += " records returned.";
  results_txt.text = temp;
  // The following line binds the recordset to the grid
  myGrid.dataProvider = result_rs;
}

// Responder function for status
function getSearchResult_Status (error) {
  results_txt.text = "There was an error: " + error.description;
}